Common Jobs

Common Jobs Logo

React

1 / 37

1. What is the primary use of the componentDidUpdate method in a class component?

2 / 37

2. What is the primary purpose of props in React?

3 / 37

3. What does the following JSX code render?

{'Hello' + 'World'}

4 / 37

4. What are Props in React?

5 / 37

5. What is the correct order of lifecycle phases in a React class component?

6 / 37

6. Which of the following is a correct way to define a component's initial state in a class component?

7 / 37

7. What will be displayed on the screen for the following JSX code:
<div>{2 * 5}</div>

8 / 37

8. Which of the following command is used to Install create-react-app?

9 / 37

9. How are state and props different in React?

10 / 37

10. Which of the following is a correct way to comment in JSX?

11 / 37

11. Which feature of React allows it to efficiently update the UI?

12 / 37

12. What is the correct syntax for embedding a JavaScript expression in JSX?

13 / 37

13. JSX is processed into...

14 / 37

14. What is the issue in this component definition?

function MyComponent(props) { return <h1>{props.title}</h1>; }

 

15 / 37

15. How many elements can a valid react component return?

16 / 37

16. Which of the following acts as the input of a class-based component?

17 / 37

17. Identify the error in the following JSX:

<div>Hello World</div><div>Welcome</div>

18 / 37

18. What is React primarily used for?

19 / 37

19. What is React.js?

20 / 37

20. What does the setState() function do in a class component?

21 / 37

21. A functional component in React is...

22 / 37

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

23 / 37

23. 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}

; } }

24 / 37

24. Which of the following is used to pass data to a component from outside in React?

25 / 37

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

26 / 37

26. JSX elements must be wrapped in an enclosing tag.
What is this concept known as?

27 / 37

27. In JSX, how do you express JavaScript variables?

28 / 37

28. In React, what is the role of a key prop in a list of elements?

29 / 37

29. Which lifecycle method is called right before a component is unmounted from the DOM?

30 / 37

30. How does React determine whether to re-render a component in response to state changes?

31 / 37

31. Which of the following is method is not a part of ReactDOM?

32 / 37

32. Which of the following is correct about prop in react?

33 / 37

33. Which of the following is true about React components?

34 / 37

34. In which condition is the React.js Lifecycle method static
getDerivedSateFromProps(props, state) is called?

35 / 37

35. JSX stands for...

36 / 37

36. Consider this code snippet:

<div><MyComponent /></div

What does MyComponent represent here?

37 / 37

37. In which lifecycle method should you make API calls in a class component?

Your score is

The average score is 44%

0%