React Questions

0 votes, 0 avg
108

React Questions

1 / 15

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

2 / 15

2. React.js was Initially released in …………….

3 / 15

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

4 / 15

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

5 / 15

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

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

6 / 15

6. How can you combine the following arrays using the spread operator?

7 / 15

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

  function Dish(props) {
  return (

{props.name} {props.cookingTime}

);

8 / 15

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

9 / 15

9. What is the output of the following code?

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

10 / 15

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

11 / 15

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

12 / 15

12. 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 > 

13 / 15

13. For controlled components in react

14 / 15

14. Why React is faster then normal websites?

15 / 15

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

Your score is

The average score is 43%

0%