Common Jobs

Common Jobs Logo

React

1 / 37

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

2 / 37

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

3 / 37

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

4 / 37

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

5 / 37

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

6 / 37

6. JSX is processed into...

7 / 37

7. A functional component in React is...

8 / 37

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

9 / 37

9. What is React primarily used for?

10 / 37

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

11 / 37

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

12 / 37

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

13 / 37

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

14 / 37

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

; } }

15 / 37

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

16 / 37

16. Identify the error in the following JSX:

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

17 / 37

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

18 / 37

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

19 / 37

19. What is the issue in this component definition?

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

 

20 / 37

20. Consider this code snippet:

<div><MyComponent /></div> 

What does MyComponent represent here?

21 / 37

21. How are state and props different in React?

22 / 37

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

23 / 37

23. JSX stands for...

24 / 37

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

25 / 37

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

26 / 37

26. What is React.js?

27 / 37

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

28 / 37

28. What are Props in React?

29 / 37

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

30 / 37

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

31 / 37

31. What does the following JSX code render?

{'Hello' + 'World'}

32 / 37

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

33 / 37

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

34 / 37

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

35 / 37

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

36 / 37

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

37 / 37

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

Your score is

The average score is 42%

0%