React Js MCQ Online Test
- React.js is a free and open-source front-end .................
- React.js was Initially released in ................
- React.js has Written in ................
- ............. is used in React.js to increase performance?
- What is Babel?
- Which of the following command is used to create a react app?
- .............. port is the default where the webpack-dev-server will run.
- A valid react component can return only ......... element.
- A state in React.js is also known is ..............
- In React js what is used to pass data to a component from outside?
- How can you access the state of a component from inside of a member function?
- Props are __________ into other components.
- What is a react.js in MVC?
- Keys are given to a list of elements in react. These keys should be -
React JS is the latest and most popular JavaScript framework. This React Js MCQ Test contains 30+ React Js Multiple Choice Questions. So, you have to select the right answer to check your final preparation for your Exams & Interviews. Besides this, you can also download the PDF Completely Free.
Last Updated: Mar 17, 2023
Posted in Interview Questions

1. React.js is a free and open-source front-end .................
- JavaScript library
- Bootstrap library
- CSS library
- None of the Above
View Answer JavaScript library
Exp: React js is a free and open-source JavaScript library for building user interfaces. It is an ideal solution if you need to build fast and dynamic UIs on the web or mobile.
2. React.js was Initially released in ................
- May 29, 2013
- April 29, 2013
- June 29, 2013
- May 29, 2014
View Answer May 29, 2013
Expl: React was initially released on May 29, 2013. recently, this is maintain by Meta and the community.
3. React.js has Written in ................
- JavaScript
- Python
- Java
- Php
View Answer JavaScript
Expl: React.js has written in JavaScript programming language.
4. ............. is used in React.js to increase performance?
- Virtual DOM
- Original DOM
- Both Original & Virtual DOM
- None of the Above
View Answer Virtual DOM
Expl: Virtual DOM is used in React.js to increase performance. The full form of DOM is Document Object Model. The virtual DOM is only a virtual representation of the DOM, where the virtual representation of a UI is kept in memory.
5. What is Babel?
- A JavaScript transpiler
- A JavaScript interpreter
- A JavaScript Compiler
- None of the above
View Answer A JavaScript Compiler
Expl: Babel is a Javascript transpiler that allows us to use future JavaScript in today's browsers.
6. Which of the following command is used to create a react app?
- install -g create-react-app
- npm install create-react-app
- npx create-react-app reactapp
- None of the Above
View Answer npx create-react-app reactapp
Expl: npx create-react-app reactapp command is used to create a react app.
7. .............. port is the default where the webpack-dev-server will run.
View Answer 8080
Expl: Port 8080 is the default where the webpack-dev-server will run in react js.
8. A valid react component can return only ......... element.
View Answer 1
Expl: A valid react component can return only one element.
9. A state in React.js is also known is ..............
- A permanent storage.
- An Internal storage of the component.
- An External storage of the component.
- All of the above
View Answer An Internal storage of the component.
Expl: A state in React.js is also known as the Internal storage of the component. It acts as a container for any data that may be used within your component and can be read and written during rendering your application.
10. In React js what is used to pass data to a component from outside?
- setState
- render with arguments
- props
- PropTypes
View Answer Props
Expl: Props are used to pass data to a component from outside in react js.
11. How can you access the state of a component from inside of a member function?
- this.getState()
- this.values
- this.prototype.stateValue
- this.state
View Answer this.values
Expl: With the help of this.values, we can access the state of a component from inside of a member function in react js.
12. Props are __________ into other components.
- Methods
- Injected
- Both 1 & 2
- All of the above
View Answer Methods
Expl: Props are methods into other components.
13. What is a react.js in MVC?
- Middleware
- Controller
- Model
- View
View Answer View
Expl: React.js is considered as the View in MVC (Model View Controller).
14. Keys are given to a list of elements in react. These keys should be -
- Do not requires to be unique
- Unique in the DOM
- Unique among the siblings only
- All of the above
View Answer Unique among the siblings only
Expl: Keys are given to a list of elements in react. These keys should be unique among the siblings only.
15. Which of the following is the correct data flow sequence of flux concept?
- Dispatcher->Action->Store->View
- Action->Dispatcher->View->Store
- Action->Dispatcher->Store->View
- Action->Store->Dispatcher->View
View Answer Action->Dispatcher->Store->View
Expl: Action->Dispatcher->Store->View is the correct data flow sequence of flux concept.
16. React.js covers only the view layer of the app.
View Answer Yes
Expl: React.js covers only the view layer of the app.
17. React was originally developed by ...............
- Jordan Walke
- Rasmus Lerdorf
- Miško Hevery
- None of the above
View Answer Jordan Walke
Expl: React was originally developed by Jordan Walke. It was initially released on 29 May 2013 (About 9 years ago).
18. .............. helps react for keeping their data unidirectional.
View Answer Flux
Expl: Flux helps react for keeping their data unidirectional. It is an architecture pattern that enables you to design a client-side application with a single unified data layer.
19. React merges the object you provide into the current state using setState().
View Answer True
Expl: True! using setState(), react merges the object you provide into the current state.
20. Arbitrary inputs of components are called ...........
View Answer Props
Expl: Arbitrary inputs of components are called Props.
21. We can prevent default behavior in React using ............
- revokeDefault()
- preventDefault()
- avoidDefault()
- None of the Above
View Answer preventDefault()
Expl: We can prevent default behavior in React using preventDefault().
22. React is mainly used for building ................
- Database
- User interface
- Connectivity
- Design platform
View Answer User interface
Expl: React is mainly used for building user interfaces.
23. What is the smallest building block of ReactJS?
- props
- elements
- components
- None of the Above
View Answer components
Expl: components is the smallest building block of ReactJS. We can say "React is all about components".
24. Which function is used to change the state of react component?
- this.State{}
- this.setState
- this.setChangeState
- None of the Above
View Answer this.setState
Expl: this.setState function is used to change the state of react component.
25. What is React js?
- client-side framework
- server-side framework
- ui (user interface) framework
- None of the above
View Answer ui (user interface) framework
Expl: React js is a ui (user interface) framework, written in javascript.
26. Which of the following is used to create a class inheritance?
- this
- Create
- Extends
- Inherits
View Answer Extends
Expl: Extends are used to create a class inheritance in react js.
27. What are the ways to handle data in react.js?
- state & services
- state & component
- State & props
- services & component
View Answer State & props
Expl: State & props are the two ways to handle data in react.js.
28. Which of the following method is used for the parent class in React.Js?
- self()
- this()
- Inherits()
- super()
View Answer super()
Expl: super() method is used for the parent class in React.Js.
29. React components are saved in ....................... directory.
- js/components
- components/js
- vendor/components
- None of the above
View Answer js/components
Expl: React components are saved in js/components directory.
30. useLayoutEffect function is used to .................
- complete the update
- optimize for all devices
- change the layout of the screen
- when we need the browser to paint before effectors
View Answer when we need the browser to paint before effectors
Expl; In react.js useLayoutEffect function is used, when we need the browser to paint before effectors.