React Questions

0 votes, 0 avg
101

React Questions

1 / 15

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

2 / 15

2. Which of the following is used in React.js to increase performance?

3 / 15

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

  function Dish(props) {
  return (

{props.name} {props.cookingTime}

);

4 / 15

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

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. What will happen if you render an input element with disabled = {false}?

7 / 15

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

8 / 15

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

9 / 15

9.  What is the use of React hooks?

10 / 15

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

11 / 15

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

12 / 15

12. What are the limitations of ReactJS?

13 / 15

13. Which of the following are the advantages of React.js?

14 / 15

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

15 / 15

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

Your score is

The average score is 42%

0%