React Quiz-4

Last Updated :
Discuss
Comments

Question 1

What is the use of "webpack" command in React.js?

  • The "webpack" command is used to transpile all the JavaScript down into one file.

  • It runs React local development server.

  • It is a module bundler.

  • None of the above.

Question 2

Which of the following function is called to render HTML to the web page in React?

  • render()

  • ReactDOM_render()

  • BOTH

  • None of the above.

Question 3

Which of the following lifecycle events React components have at the highest level?

  • Destruction

  • Initialization

  • State/Property Updates

  • All of the above

Question 4

Which of the following best defines the "key" prop?

  • "Key" prop is used to look pretty, and there is no benefit whatsoever.

  • "Key" prop is a way for React to identify a newly added item in a list and compare it during the "diffing" algorithm.

  • It is one of the attributes in HTML.

  • It is NOT commonly used in an array.

Question 5

Which of the following method is not a part of ReactDOM?

  • ReactDOM.destroy()

  • ReactDOM.hydrate()

  • ReactDOM.createPortal()

  • ReactDOM.findDOMNode()

Question 6

How can you set a default value for an uncontrolled form field?

  • By using the value property

  • By using the defaultValue property

  • By using the default property

  • It is assigned automatically.

Question 7

We can update the state in React.js by calling to setState() method. These calls are:

  • Synchronous in nature.

  • Asynchronous in nature.

  • Are asynchronous but can be made synchronous when required.

  • None of the above.

Question 8

Which of the following statement is true for controlled components in React.js?

  • The source of truth is DOM.

  • The source of truth can be anything.

  • The source of truth is a component state.

  • None of the above.

Question 9

What changes would appear in the component as soon as the state of the React component is changed?

  • It will do nothing; you have to call render method to render the component again.

  • It will re-render the component.

  • It can be created again from scratch.

  • None of the above.

Question 10

Which of the following statement is true for uncontrolled components in React.js?

  • The source of truth is DOM.

  • The source of truth is a component state.

  • The source of truth can be anything.

  • None of the above.

There are 25 questions to complete.

Take a part in the ongoing discussion