React Questions

0 votes, 0 avg
115

React Questions

1 / 15

1. How do you fix the syntax error that results from running this code?

const person =(firstName, lastName) =>
{
  first: firstName,
  last: lastName
}
console.log(person("Jill", "Wilson"))

2 / 15

2. How do you set a default value for an uncontrolled form field?

3 / 15

3. 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);

4 / 15

4. When rendering a list using the JavaScript map() method, what is required for each element rendered?

5 / 15

5.  What is the use of React hooks?

6 / 15

6. Which attribute is React’s replacement for using innerHTML in the browser DOM?

7 / 15

7. What is a react.js in MVC?

8 / 15

8.  To create a constant in JavaScript, which keyword do you use?

9 / 15

9. 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;

10 / 15

10. Find the bug in this code :

  function car({make, model}) {
  return < h1 > {make} {model} < /h1 > ;
}; 

11 / 15

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

12 / 15

12. React component names must begin with an uppercase letter.

13 / 15

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

14 / 15

14. What is the use of “webpack” command in React.js?

15 / 15

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

Your score is

The average score is 43%

0%

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

Scroll to Top