Common Jobs
React
1 / 37
1. React.js is written in which of the following language?
2 / 37
2. What does the following JSX code render?
{'Hello' + 'World'}
3 / 37
3. What is the correct order of lifecycle phases in a React class component?
4 / 37
4. What is the issue in this component definition?
function MyComponent(props) { return <h1>{props.title}</h1>; }
Â
5 / 37
5. Identify the error in the following JSX:
<div>Hello World</div><div>Welcome</div>
6 / 37
6. In JSX, how do you express JavaScript variables?
7 / 37
7. Which of the following is correct about prop in react?
8 / 37
8. What are Props in React?
9 / 37
9. JSX stands for...
10 / 37
10. Which of the following is a correct way to define a component's initial state in a class component?
11 / 37
11. Which of the following is a correct way to comment in JSX?
12 / 37
12. How does React determine whether to re-render a component in response to state changes?
13 / 37
13. Consider this code snippet:
<div><MyComponent /></div>Â
What does MyComponent represent here?
14 / 37
14. In React, what is the role of a key prop in a list of elements?
15 / 37
15. Which of the following command is used to Install create-react-app?
16 / 37
16. Which of the following acts as the input of a class-based component?
17 / 37
17. What will be the output of this code snippet?class MyComponent extends React.Component {constructor(props) {super(props);this.state = { count: 1 };} render() {return
{this.state.count}
; } }
18 / 37
18. Which of the following is method is not a part of ReactDOM?
19 / 37
19. Which lifecycle method is called right before a component is unmounted from the DOM?
20 / 37
20. What is the primary use of the componentDidUpdate method in a class component?
21 / 37
21. What does the setState() function do in a class component?
22 / 37
22. JSX is processed into...
23 / 37
23. How many elements can a valid react component return?
24 / 37
24. What is React primarily used for?
25 / 37
25. Which feature of React allows it to efficiently update the UI?
26 / 37
26. In which condition is the React.js Lifecycle method staticgetDerivedSateFromProps(props, state) is called?
27 / 37
27. How are state and props different in React?
28 / 37
28. Which of the following is true about React components?
29 / 37
29. In which of the following directory React Components are saved?
30 / 37
30. A functional component in React is...
31 / 37
31. In which lifecycle method should you make API calls in a class component?
32 / 37
32. What is the primary purpose of props in React?
33 / 37
33. What is the correct syntax for embedding a JavaScript expression in JSX?
34 / 37
34. JSX elements must be wrapped in an enclosing tag.What is this concept known as?
35 / 37
35. What will be displayed on the screen for the following JSX code:<div>{2 * 5}</div>
36 / 37
36. Which of the following is used to pass data to a component from outside in React?
37 / 37
37. What is React.js?
Your score is
The average score is 43%
Restart quiz