React MCQ
React MCQ
React MCQ
A. Virtual DOM
B. Original DOM
C. Both A and B
D. None of the above
2. What is ReactJS?
A. Server-side framework
B. user interface framework
C. both a and b
D. none of the above
3. Identify the one which is used to pass data to components from outside
A. Jordan Mike
B. Jordan Walke
C. Tim Lee
D. Jordan Lee
A. Python
B. JavaScript
C. Java
6. What is Babel?
A. JavaScript compiler
B. JavaScript interpreter
C. JavaScript transpiler
D. None of the above
A. 3000
B. 3306
C. 3030
D. 8080
A. 1
B. 2
C. 3
D. 4
A. this.prototype.stateValue
B. this,getState()
C. this.values
D. this.state
12. State whether true or false: Props are methods into other components?
A. True
B. False
A. Elements
B. Props
C. Keys
D. Ref
A. Model
B. Controller
C. Router
D. Middleware
15. State whether true or false: React.js covers only the view layer of the app.
A. True
B. False
16. Among The following options, choose the one which helps react for keeping
their data uni-directional?
A. DOM
B. Flux
C. JSX
D. Props
A. Props
B. Elements
C. Components
D. None of the above
A. Database
B. Connectivity
C. User interface
D. Design platform
A. this.setState()
B. this.state()
C. this.setChangeState()
D. None of the above
A. Factory
B. Render
C. Class
D. props
A. Inherits
B. Extends
C. Create
D. this
A. 1
B. 2
C. 3
D. 4
A. renderComponent
B. SetinitialComponent
C. Render
D. All of the above
A. ECMA 6
B. ECMAJavaScript 6
C. ECMAScript 6
D. EJavaScript 6
A. this()
B. super()
C. iniherits()
D. self()
A. Javascript XML
B. JSON XML
C. JSON
D. Javascript and AngularJS
A. ReactDOM_render()
B. render()
C. render_DOM()
D. DOM_HTML()
A. ReactDOM.createPortal()
B. ReactDOM.hydrate()
C. ReactDOM.destroy()
D. ReactDOM.findDOMNode()
A. vendor/js/components/
B. components/js
C. js/components
D. vendor/components
36. State whether true or false: React merges the objects you provide into the
current state using setState().
A. True
B. False
A. True
B. False
A. Apple
B. Facebook
C. Google
D. Twitter
A. componentDidUpdate
B. componentDidMount
C. willComponentUpdate
D. shouldComponentUpdate
A. <h1>${fetch()}</h1>
B. <h1>{fetch}</h1>
C. <h1>${fetch}</h1>
D. <h1>{fetch()}</h1>
45. React is a ___________
A. JavaScript framework
B. JavaScript library
C. both a and b
D. none of the above
A. Sinon
B. Chai
C. Jest
D. Mocha
A. React.lazy
B. React.memo
C. React.fallback
A. Imperative
B. Integrated
C. Declarative
D. closed
60. Which of the following is used to pass data to a component from outside in
React?
a) props
b) render with arguments
c) setState
d) PropTypes
66. A class is a type of function, but instead of using the keyword function to
initiate it, which keyword do we use?
A. Constructor
B. Class
C. Object
D. DataObject
var Helloword=(props)=>
{
return(
<div>
Hello World 1
</div>
<div>
Hello World 2
</div>
);
} ReactDOM.render(<Helloworld/>,mountNode)
A. Hello World 1
B. Hello World 2
C. Hello World 1 Hello World 2
D. Error
A. 3000
B. 8080
C. 3030
D. 6060.
71. How many numbers of elements a valid react component can return?
A. 1
B. 2
C. 4
D. 5
72. What is the declarative way to render a dynamic list of components based
on values in an array?
A. 1
B. 3
C. 4
D. 5
A. A permanent storage.
B. Internal storage of the component.
C. External storage of the component.
D. None of the above.
77. Which of the following is a must API for every React.js component?
A. SetinitialComponent
B. renderComponent
C. render
D. All of the above
78. Which of the following option is correct in the case of the Babel?
A. Babel is a Compiler.
B. Babel is a Transpilar.
C. None of the above.
D. Both A and B are correct.
A. TRUE
B. FALSE
C. Can be true or false
D. Cannot say
80. What is the use of "webpack" command in React.js?
A. The "webpack" command is used to transpile all the JavaScript down into
one file.
B. It runs React local development server.
C. It is a module bundler.
D. None of the above.
81. Which of the following is used to pass data to a component from outside in
React.js?
A. SetState
B. Render with arguments
C. Props
D. PropTypes
A. ECMAScript 6
B. ECMA 6
C. ECMAJavaScript 6
D. EJavaScript 6
83. Which of the following function is used to change the state of the React.js
component?
A. this.setState
B. this.setChangeState
C. this.State{}
D. None of the above.
84. Which of the following method refers to the parent class in React.js?
A. inherits()
B. self()
C. super()
D. this()
85. What will happen if you render an input element with disabled = {false}?
A. It will be rendered as disabled
B. It will not be rendered at all
C. It will be rendered as enabled
D. You cannot set it false.
86. Which of the following function is called to render HTML to the web page in
React?
A. render()
B. render[]
C. ReactDOM_render()
D. Render{}
87. Which of the following lifecycle events React components have at the highest
level?
A. Destruction
B. Initialization
C. State/Property Updates
D. All of the above.
A. ReactDOM.destroy()
B. ReactDOM.hydrate()
C. ReactDOM.createPortal()
D. ReactDOM.findDOMNode()
81. How can you set a default value for an uncontrolled form field?
82. We can update the state in React.js by calling to setState() method. These calls
are:
A. Synchronous in nature.
B. Asynchronous in nature.
C. Are asynchronous but can be made synchronous when required.
D. None of the above.
84. What changes would appear in the component as soon as the state of the
React component is changed?
A. It will do nothing; you have to call render method to render the component
again.
B. It will re-render the component.
C. It can be created again from scratch.
D. None of the above.
86. In which of the following condition, the React.js Lifecycle method static
getDerivedSateFromProps(props, state) is called?
87. What is the use of the create-react-app command in the React.js application?
88. What is true for the keys given to a list of elements in React?
A. create-react-app
B. new-react-app
C. create-new-reactapp
D. react-app
A. Proper Arguments
B. Properties
C. Proper Return Values
D. All of the above
A. ReactJS
B. js
C. Both A. and B.
D. None of these
A. JSON
B. JSON XML
C. JavaScript XML
D. JavaScript and AngularJS
A. [ expression ]
B. { expression }
C. {{ expression }}
D. _expression
A. extends React.Component
B. extends React
C. extends Component
D. extends React.Component.All
96. Which ReactJS command is used to set up everything you need to run a React
Application?
A. create-react-app
B. new-react-app
C. create-new-reactapp
D. react-app
A. Variable components
B. Function components
C. Class components
D. Both A. and B.
E. Both B. and C.
A. Yes
B. No
110. Which of the following is used to pass data to a component from outside in
React?
a) props
b) render with arguments
c) setState
d) PropTypes
111.At the highest level, React components have lifecycle events that fall into
a)Initialization
b)State/Property Updates
c)Destruction
d)All of these
112. How do you write an inline style specifying the font-size:12px and color:red;
in JSX
a)style={{font-size:12,color:'red'}}
b)style={{fontSize:'12px',color:'red'}}
c)style={fontSize:'12px',color:'red'}
d)style={{font-size:12px,color:'red'}}
113. Which method is not part of ReactDOM?
a)ReactDOM.destroy()
b)ReactDOM.hydrate()
c)ReactDOM.createPortal()
d)ReactDOM.findDOMNode()
114. Which of the following API is a MUST for every ReactJS component?
a)getInitialState
b)render
c)renderComponent
b)An input element that is controlled by the value of another input element
117.What happens when the following render() method executes?<br /><br />
render(){<br /> let langs = ["Ruby","ES6","Scala"]<br /> return (<div><br />
{langs.map(it => <p>{it}</p>)}<br /> </div>)<br /> }<br />
c) Displays nothing
118.What are the two ways that data gets handled in React?
A. Package
B. Model
C. Method
D. Component
120. What function allows you to render React content in an HTML page?
A. React.mount()
B. ReactDOM.start()
C. ReactDOM.render()
D. React.render()
121. What is state in React?
A. A persistant storage.
B. An internal data store (object) of a component.
A. Mounting, Unmounting
B. Mounting, Updating
C. Mounting, Updating, Unmounting
D. All of above
123. One can define default values for properties, props, using which of the
following method?
A. getDefaultProps
B. getPropsValue
C. getInitialState
D. None of these
A. Yes
B. No
A. Props
B. Statefull
C. Stateless
D. State
A. setState()
B. updateState()
C. upState()
D. downState()
A. Apple
B. Facebook
C. Twitter
D. Google
A. When the new state should completely replace the old state
B. When the new state depends on the old state
C. When the new state does not depend on the old state
D. None of the above
131. Which of the following below act as the input of a class-based component?
A. class and factory
B. render and mount
C. props
D. none of the above
A. UseState, Stateless
B. Statefull, Stateless
C. Unstatefull Statefull
D. None of these
A. Yes
B. No
A. Jordan mike
B. Jordan Walke
C. Nile
D. Nike John
A. Connectivity
B. User Interface
C. Database
D. All of above
A. Framework
B. Library
C. None of these.
A. Google
B. Microsoft
C. Facebook
D. All of above
A. Functional Components
B. Class Components
C. Oriented Components
D. None of these
A. Server-Side
B. Client-Side
C. For Both
D. None of these
141. Will useEffect affect other data?
A. True
B. False
A. data
B. data Alex
C. Alex
D. none of the above