Thanks You React Js - Honors IV Sem Full Stack-I React Js - Honors IV Sem Full Stack-I NameEmailPhone Number 1 / 20 Which of the following is NOT a built-in React Hook? useMemo useFetch useReducer useRef 2 / 20 Which of the following is NOT a valid React Hook? useMemo useLayoutEffect useReducer useEventListener 3 / 20 How do you update state in a function component? this.setState({ count: count + 1 }); setState(count + 1); setCount(count + 1); this.count = this.count + 1; 4 / 20 What is the default behavior of React when the state changes? It re-renders only the changed component It reloads the entire application It does nothing It manually updates the DOM 5 / 20 What is the default behavior of useEffect without a dependency array? Runs once on mount Runs every render Runs on unmount Runs only on dependency change 6 / 20 What is the best practice for handling API calls in a function component? useEffect with an empty dependency array useState inside useEffect useEffect with dependencies All of the above 7 / 20 Which hook is used to manage state in a functional component? useEffect useReducer useState useContext 8 / 20 How can you optimize performance in React applications? useMemo useCallback React.memo All of the above 9 / 20 What is the purpose of the key prop in React lists? To uniquely identify each element in the list To change the styling of the list To add event listeners To modify the list order 10 / 20 What is the correct way to use useEffect with a cleanup function? useEffect(() => { return cleanup(); }, []); useEffect(() => cleanup(), []); useEffect(() => { return () => cleanup(); }, []); useEffect(cleanup, []); 11 / 20 What is a functional component in React? A JavaScript function that returns JSX A class that extends React.Component A function with lifecycle methods A function that modifies the DOM directly 12 / 20 How do you use state in a function component? this.state = {count: 0}; const [count, setCount] = useState(0); setState({count: 0}); useReducer(countReducer, 0); 13 / 20 What happens if you update state inside useEffect without dependencies? Causes an infinite loop Executes only once Updates the state safely Prevents re-rendering 14 / 20 What is the correct way to handle multiple states in a component? Using multiple useState calls Using setState only Using useReducer Both A & C 15 / 20 Which hook is used for global state management instead of useState? useMemo useReducer useRef useEffect 16 / 20 How does React handle reconciliation? By comparing the new and old Virtual DOM By updating the entire DOM By using class components only By running a background thread 17 / 20 What does the useEffect hook do? Handles side effects in a function component Replaces useState Only updates the component on mount Replaces event handlers 18 / 20 What is JSX in React? A syntax extension for JavaScript A CSS preprocessor A JavaScript framework A state management tool 19 / 20 How do you create a functional component in React? class Component extends React.Component {} function Component() { return <div>Hello</div>; } React.createComponent('Component') new Component() 20 / 20 What is React.js? A JavaScript framework A JavaScript library for building user interfaces A programming language A database Your score isThe average score is 86% 0% Restart quiz