react-mcqs - Set (2)

Correct Answer: Orange && Worng Answer: Red

1. Among the following which acts as the input of class-based component?

  • (A). Factory
  • (B). Render
  • (C). Class
  • (D). props
  • View Answer

    Explanation: props act as the input of the class-based components.

    2. Among the following which is used to create a class inheritance?

  • (A). Inherits
  • (B). Extends
  • (C). Create
  • (D). this
  • View Answer

    Explanation: Extends are used to create a class inheritance.

    3. Choose the correct data flow sequence of flux concept.

  • (A). Action -> Dispatcher -> Store -> View
  • (B). Action -> Dispatcher -> View -> Store
  • (C). Action -> Store -> View -> Dispatcher
  • (D). Dispatcher -> Action -> Store -> View
  • View Answer

    Explanation: he correct data flow sequence of flux concept is  :  Action -> Dispatcher -> Store -> View

    4. Total ways of defining variables in ES6 is?

  • (A). 1
  • (B). 2
  • (C). 3
  • (D). 4
  • View Answer

    Explanation: There are three ways of defining variables in ES6: let, var and const.

    5. Which of the following are two ways to handle data in react?

  • (A). services and components
  • (B). State and props
  • (C). state and services
  • (D). state and component
  • View Answer

    Explanation: State and props is used to handle data in react.

    6. Among the corner which is a must-have for every ReactJS component?

  • (A). renderComponent
  • (B). SetinitialComponent
  • (C). Render
  • (D). All of the above
  • View Answer

    Explanation: renderComponent is a must-have for every ReactJS component.

    7. ES6 stands for _________

  • (A). ECMA 6
  • (B). ECMAJavaScript 6
  • (C). ECMAScript 6
  • (D). EJavaScript 6
  • View Answer

    Explanation: ES6 stands for ECMAScript 6.

    8. Choose the method with refers to the parent class in ReactJS?

  • (A). this()
  • (B). super()
  • (C). iniherits()
  • (D). self()
  • View Answer

    Explanation: super() refers to the parent class in ReactJS.

    9. JSX stands for __________

  • (A). Javascript XML
  • (B). JSON XML
  • (C). JSON
  • (D). Javascript and AngularJS
  • View Answer

    Explanation: JSX stands for Javascript XML.

    10. The function which is called to render HTML to a web page in react?

  • (A). ReactDOM_render()
  • (B). render()
  • (C). render_DOM()
  • (D). DOM_HTML()
  • View Answer

    Explanation: render() is called to render HTML to a web page in react.

    11. Choose the functionality of setState?

  • (A). Access the previous state before the setState operation.
  • (B). invoke code after the setState  operation is done
  • (C). replace this date completely instead of the default merge actionnone of the above
  • (D). none of the above
  • View Answer

    Explanation: setState invoke code after the setState operation is done.

    12. Choose the method which is not a part of ReactDOM?

  • (A). ReactDOM.createPortal()
  • (B). ReactDOM.hydrate()
  • (C). ReactDOM.destroy()
  • (D). ReactDOM.findDOMNode()
  • View Answer

    Explanation: ReactDOM.destroy() is not a part of ReactDOM.

    13. Choose the correct statement in the context of uncontrolled components in ReactJS?

  • (A). source of truth can be anything
  • (B). source of truth is a component state
  • (C). source of truth is DOM
  • (D). none of the above
  • View Answer

    Explanation: Source of truth is DOM is correct in the context of uncontrolled components in ReactJS.

    14. In which directory is react component saved?

  • (A). vendor/js/components/
  • (B). components/js
  • (C). js/components
  • (D). vendor/components
  • View Answer

    Explanation: React component is saved in js/components in/.

    15. What is the functionality of a “webpack” command?

  • (A). Runs react local development server
  • (B). transfer files all the JavaScript down into one file
  • (C). a module blunder
  • (D). none of the above
  • View Answer

    Explanation: Webpack is a model blunder.

    16. State whether true or false: React merges the objects you provide into the current state using setState().

  • (A). True
  • (B). False
  • View Answer

    Explanation: The above statement is true.

    17. State whether true or false: React creates virtual DOM in memory.

  • (A). True
  • (B). False
  • View Answer

    Explanation: The above statement is true.

    18. In react, the key should be?

  • (A). Unique among his siblings only
  • (B). unique in the DOM
  • (C). Does not requires to be unique
  • (D). all of the above
  • View Answer

    Explanation: The key should be unique among his siblings only.

    19. Which company developed ReactJS?

  • (A). Apple
  • (B). Facebook
  • (C). Google
  • (D). Twitter
  • View Answer

    Explanation: ReactJS was developed by Facebook.

    20. Choose the component which should be overridden to stop the component from updating?

  • (A). componentDidUpdate
  • (B). componentDidMount
  • (C). willComponentUpdate
  • (D). shouldComponentUpdate
  • View Answer

    Explanation: shouldComponentUpdate should be override to stop the component from updating.