react-mcqs - Set (1)

Correct Answer: Orange && Worng Answer: Red

1. Which of the following is used in React.js to increase performance?

  • (A). Virtual DOM
  • (B). Original DOM
  • (C). Both A and B
  • (D). None of the above
  • View Answer

    Explanation: Virtual DOM is used in React.js to increase performance.

    2. What is ReactJS?

  • (A). Server-side framework
  • (B). user interface framework
  • (C). both a and b
  • (D). none of the above
  • View Answer

    Explanation: ReactJS is a user-interface framework.

    3. Identify the one which is used to pass data to components from outside

  • (A). Render with arguments
  • (B). setState
  • (C). PropTypes
  • (D). props
  • View Answer

    Explanation: props are used to pass data to components from outside.

    4. Who created React.js?

  • (A). Jordan Mike
  • (B). Jordan Walke
  • (C). Tim Lee
  • (D). Jordan Lee
  • View Answer

    Explanation: Jordan Walke created React.js.

    5. In which language is React.js written?

  • (A). Python
  • (B). JavaScript
  • (C). Java
  • (D). PHP
  • View Answer

    Explanation: React.js is written in Javascript.

    6. What is Babel?

  • (A). JavaScript compiler
  • (B). JavaScript interpreter
  • (C). JavaScript transpiler
  • (D). None of the above
  • View Answer

    Explanation: Devil is a JavaScript compiler.

    7. Identify the command used to create a react app.

  • (A). npm install create-react-app
  • (B). npm install -g create-react-app
  • (C). install -g create-react-app
  • (D). None of the above
  • View Answer

    Explanation: npm install -g create-react-app is used to create a react app.

    8. Which of the following port is the default where webpack-dev-server runs?

  • (A). 3000
  • (B). 3306
  • (C). 3030
  • (D). 8080
  • View Answer

    Explanation: 8080 is the default where webpack-dev-server runs.

    9. How many elements can a valid react component return?

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

    Explanation: A valid red component can return only 1 element.

    10. A state in React.js is also known as?

  • (A). The internal storage of the component
  • (B). External storage of the component
  • (C). Permanent storage
  • (D). All of the above
  • View Answer

    Explanation: A state in React.js is also known as the internal storage of the component.

    11. Which of the following method is used to access the state of a component from inside of a member function?

  • (A). this.prototype.stateValue
  • (B). this,getState()
  • (C). this.values
  • (D). this.state
  • View Answer

    Explanation: this.values is used to access the state of a component from inside of a member function.

    12. State whether true or false:  Props are methods into other components?

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

    Explanation: The above statement is True.

    13. What are arbitrary inputs of components in react also known as?

  • (A). Elements
  • (B). Props
  • (C). Keys
  • (D). Ref
  • View Answer

    Explanation: Arbitrary inputs of components in react also known as Props.

    14. In MVC, what does React.js act as?

  • (A). Model
  • (B). Controller
  • (C). Router
  • (D). Middleware
  • View Answer

    Explanation: In MVC, React.js act as Controller.

    15. State whether true or false: React.js covers only the view layer of the app.

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

    Explanation: The above statement is true.

    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
  • View Answer

    Explanation: FLux helps react for keeping their data uni-directional.

    17. Using which of the following command can prevent default behaviour at in react?

  • (A). preventDefault()
  • (B). avoidDefault()
  • (C). revokeDefault()
  • (D). None of the above
  • View Answer

    Explanation: preventDefault() is used to prevent default behavior in react.

    18. Identify the smallest building block of React.JS.

  • (A). Props
  • (B). Elements
  • (C). Components
  • (D). None of the above
  • View Answer

    Explanation: Components are the smallest building blocks of ReactJS.

    19. What is ReactJS mainly used for building?

  • (A). Database
  • (B). Connectivity
  • (C). User interface
  • (D). Design platform
  • View Answer

    Explanation: ReactJS is mainly used for building user interfaces.

    20. Which of the following function is used to change the state of react component?

  • (A). this.setState()
  • (B). this.state()
  • (C). this.setChangeState()
  • (D). None of the above
  • View Answer

    Explanation: this.setState() is used to change the state of react component.