Explanation: The useState hook is used to create and manage local component state in functional components.
Dear candidates you will find MCQ questions of React Js here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
Explanation: The useState hook is used to create and manage local component state in functional components.
Explanation: ReactDOM.render() is used to render a React element into the DOM.
Explanation: JSX is a syntax extension that allows mixing HTML with JavaScript.
Explanation: The useEffect hook is used to perform side effects like data fetching or DOM manipulation.
Explanation: The virtual DOM is a lightweight copy of the real DOM that React uses for efficient updates.
const [count, setCount] = useState();
Explanation: If no argument is passed to useState, the default state is undefined.
Explanation: Props are used to pass data from parent to child components in React.
Explanation: React.memo is a higher-order component that prevents re-rendering if props do not change.
Explanation: Keys help React identify which items have changed, been added, or removed.
Explanation: Custom hooks allow you to extract and reuse logic between components.