24th
Dec
React JS MCQ

React JS MCQ

  • Admin
  • 24th Dec, 2020
  • 489 Followers

React JS Multiple choice interview questions (MCQ) - Test your React JS knowledge

1) To update state in react forcefully, which method is used

  • A. setState
  • B. forceUpdate
  • C. Both of above
  • D. None of above

2) What does ReactJS use to increase performance?

  • A. Virtual DOM
  • B. Original DOM
  • C. Local DOM
  • D. None of the Above

3) A valid react component can return ...... number of elements.

  • A. 1
  • B. 2
  • C. 3
  • D. None of the Above

4) What will happen if you render an input element with disabled = {false}

  • A. It will be rendered as enabled
  • B. It will be rendered as disabled
  • C. It will not be rendered at all

5) Which of the following API is a MUST for every ReactJS component?

  • A. getInitialState
  • B. render
  • C. renderComponent
  • D. None
Download Free : React JS MCQ PDF

6) How many stages are there in React js life cycle

  • A. 1
  • B. 2
  • C. 3
  • D. 0

7) What does ReactJS cover?

  • A. Data layer in an application
  • B. User Interface layer in an application
  • C. Both A & B
  • D. All are Correct

8) In relation to React js component lifecycle, which statement is true

  • A. only function component can have life cycle
  • B. Only class components can have life cycle
  • C. Both type of components can have life cycle
  • D. None of above

9) The state in react can be updated by call 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 above

10) What is a good use case for using a function while rendering a dynamic list of items

  • A. If we need to compute a value based on properties of items in the loop.
  • B. None. Functions should not be used while rendering a dynamic list.
  • C. To make the code shorter
Read Best: React JS MCQ

11) Which of the following is a correct definition of state in react?

  • A. A persistent storage
  • B. An internal data store (object) of component
  • C. Both
  • D. None

12) Regarding React js components, which of following statement is true?

  • A. function components can have state
  • B. function components are light weight
  • C. class components are light weight
  • D. class components are faster than function component

13) For uncontrolled components in react

  • A. Source of truth is DOM
  • B. Source of truth is component state
  • C. Source of truth can be anything
  • D. None of above

14) ReactJS uses _____ to increase performance

  • A. Virtual DOM
  • B. Original DOM
  • C. Both of above
  • D. None of above

15) Ref in react component is used to assign reference to DOM elements. Ref can be created by

  • A. Calling React.createRef method
  • B. Assigning a value to ref attribute in JSX
  • C. Both of above
  • D. None of above
Download Free: React JS MCQ PDF

16) What is the second argument for setState useful for?

  • A. To invoke code after the setState operation is done
  • B. To replace the state completely instead of the default merge action
  • C. To access the previous state before the setState operation

17) For controlled components in react

  • A. Source of truth is DOM
  • B. Source of truth is component state
  • C. Source of truth can be anything
  • D. None of above

18) How many elements does a react component returns?

  • A. 1
  • B. 0
  • C. Multiple elements with one root element
  • D. None of the above

19) What are two ways data gets handled in react?

  • A. state & props
  • B. services & components
  • C. state & services
  • D. state & component

20) Number of elements, a valid react component can return

  • A. 1
  • B. 2
  • C. 3
  • D. 5

21) What are the limitations of ReactJS?

  • A. React is only for view layer of the app so we still need the help of other technologies to get a complete tooling set for development
  • B. React is using inline templating and JSX. This can seem awkward to some developers
  • C. The library of react is too large
  • D. All of these

22) React is ............ Javascript library

  • A. Module based
  • B. Component based
  • C. System based
  • D. All are Correct

23) React Js is developed by

  • A. Google
  • B. Microsoft
  • C. Facebook
  • D. None of above

24) Keys are given to a list of elements in react. These keys should be

  • A. Unique in the DOM
  • B. Unique among the siblings only
  • C. Do not requires to be unique
  • D. None of above

25) What is React Js?

  • A. Javascript framework
  • B. Javascript library
  • C. Javascript file
  • D. None of the Above

26) Everything in react is __________

  • A. module
  • B. component
  • C. package
  • D. class

27) What is the default port for webpack dev server?

  • A. 3000
  • B. 8080
  • C. 3306
  • D. 8809

28) React is a ________

  • A. Javascript library
  • B. Javascript framework
  • C. Both of above
  • D. None of above

29) How can you access the state of a component from inside of a member function?

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

30) In react, this is used to pass data to component from outside?

  • A. set state
  • B. render with argument
  • C. props
  • D. propTypes

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.

Related MCQ/Quiz

01st
Dec
Laravel MCQ
01st
Jan
AngularJs MCQ
01st
Jul
Node js MCQ
01st
Jul
Angular 2 MCQ
01st
Jul
JSON MCQ
01st
Jul
PHP MCQ