MCQ Quiz

What is the primary purpose of React?





What does JSX stand for?





Which of the following is a way to create a React component?





What is the purpose of the useState hook?





Which of the following is a valid way to import a component in React?





What is the virtual DOM in React?





Which method is used to handle side effects in function components?





What is the purpose of props in React?





Which of the following is not a valid lifecycle method in React?





How do you create a context in React?





What is the purpose of the key prop in React?





Which command is used to create a new React app?





What is the use of the useContext hook in React?





What is the purpose of the React.Fragment component?





What is the difference between state and props in React?





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





What is the purpose of the useReducer hook in React?





Which of the following is a common way to handle forms in React?





What is the purpose of the useRef hook in React?





Which method is used to update the state in React?





What is the purpose of the render method in React class components?





Which of the following is a way to create a functional component in React?





What is the primary purpose of React Router?





Which of the following is a valid way to handle events in React?





What is the use of the useMemo hook in React?





Which of the following is a way to fetch data in React?





What is the purpose of the useCallback hook in React?





What is the use of the useImperativeHandle hook in React?





Which of the following is not a valid hook in React?





What is the purpose of the useLayoutEffect hook in React?