Beginner

React Questions

Programming Framework
10 questions

Question 1

Which of the following is a key difference between functional components and class components in React?

Question 2

What is the purpose of event.preventDefault() in React event handling?

Question 3

Which of the following is a common approach for implementing form validation in React?

Question 4

What is the purpose of using key prop in JSX elements within a list?

Question 5

What will happen if you update the state directly in a React component?

Question 6

What is the primary difference between controlled and uncontrolled components in React forms?

Question 7

In React functional components, how do you typically handle events?

Question 8

Why is it generally not recommended to mutate the DOM directly in React?

Question 9

What is the purpose of the componentWillUnmount() lifecycle method?

Question 10

Which of the following JSX expressions is INVALID?