React Questions

0 votes, 0 avg
83

React Questions

1 / 15

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

  function Dish(props) {
  return (

{props.name} {props.cookingTime}

);

2 / 15

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

3 / 15

3. What do you call a React component that catches JavaScript errors anywhere in the child component tree?

4 / 15

4. What is the children prop?

5 / 15

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

6 / 15

6. What changes would appear in the component as soon as the state of the React component is changed?

7 / 15

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

8 / 15

8. What is the output of the following code?

const make = 'Ford';
const model = 'Mustang';
const car = { make, model };
console.log(car);

9 / 15

9. In which of the following directory React Components are saved?

10 / 15

10. Which of the following is true about the below syntax ?disabled = {false}

11 / 15

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

12 / 15

12. What is the default local host port that a React development server uses?

13 / 15

13. How can you optimize performance for a function component that always renders the same way?

14 / 15

14. JSX is acronym for 

15 / 15

15. What is the difference between the click behaviors of these two buttons (assuming that this.handleClick is bound correctly)?

A. < button onClick={this.handleClick} > Click Me < /button >  < /code> < /pre >

B. < button onClick={event => this.handleClick(event)}> Click Me < /button > 

Your score is

The average score is 40%

0%