React Questions

0 votes, 0 avg
112

React Questions

1 / 15

1. Why React is faster then normal websites?

2 / 15

2. What is the declarative way to render a dynamic list of components based on values in an array?

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. What is a react.js in MVC?

5 / 15

5. Consider the following code from React Router. What do you call :id in the path prop? > Route path=”/:id” / >

6 / 15

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

7 / 15

7. Which of the following method refers to the parent class in React.js?

8 / 15

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

9 / 15

9. Babel is a __________?

10 / 15

10. What happens when the following render() method executes?

render(){
   let langs = ["PHP","ES6","JAVA"]
     return ( < div>
       {langs.map(it =>  < p > {it}  < /p > )}
      < /div > )
 }

11 / 15

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

12 / 15

12. . What is the name of this component?

  class Clock extends React.Component {
  render() {
    return < h1 >  Look at the time: {time} < /h1>  ;
  }
}

13 / 15

13. Which of the following is must for the API in React.js ?

14 / 15

14. Why should you avoid copying the values of props into a component’s state?

15 / 15

15. How do you destructure the properties that are sent to the Dish component?

  function Dish(props) {
  return (

{props.name} {props.cookingTime}

);

Your score is

The average score is 43%

0%

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