React Questions

0 votes, 0 avg
115

React Questions

1 / 15

1. What is the purpose of useEffect hook in React?

2 / 15

2. React separates the user interface into components. How are components combinded to create a user interface?

3 / 15

3. . What is [e.target.id] called in this code snippet?

  const handleChange = (e) => {
  setState((prevState) => ({ ...prevState, [e.target.id]: e.target.value }));
}

4 / 15

4. How can you access the state of a component from inside of a member function?

5 / 15

5. React can only render elements in the root document element.

6 / 15

6. Which method in a React Component should you override to stop the component from updating?

7 / 15

7. What is the output of the below code ?

var Geeks=(props)=>
{
 return(
 

DSA Course 1
 

 

DSA Course 2
 

 );
}
ReactDOM.render( < DSA Course/ > ,mountNode)

8 / 15

8. What is the children prop?

9 / 15

9. Using object literal enhancement, you can put values back into an object. When you log person to the console, what is the output?

const name = 'Rachel';
const age = 31;
const person = { name, age };
console.log(person);

10 / 15

10. What can you use to handle code splitting?

11 / 15

11. What is the correct syntax to import a Component from React?

12 / 15

12. Which of the following is NOT a rule for React Hooks?

13 / 15

13.  How many ways of defining your variables in ES6?

14 / 15

14. What will be the output of the following code?

import React, { Component } from 'react';  
const App = () => {  
    
      return(  
          < div >  
             < h1 className = "hello" > {25+20}< /h1 >   
          < /div >  
      );   
}  
export default App;

15 / 15

15.  React.js is written in which of the following language?

Your score is

The average score is 43%

0%

Written by Shubhranshu Shekhar, who has trained 20000+ students in coding.

Scroll to Top