Explanation: componentDidMount is called immediately after the component is mounted.
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: componentDidMount is called immediately after the component is mounted.
Explanation: useRef stores a mutable value that persists across renders without triggering re-render.
Explanation: React was developed and is maintained by Facebook.
Explanation: React uses camelCase for event handlers and passes functions inside curly braces.
Explanation: useEffect can return a cleanup function that runs when the component unmounts or before the effect re-runs.
Explanation: The second argument is an array of dependencies; the effect re-runs when any dependency changes.
Explanation: Keys help React identify elements; they must be unique within their list context.
Explanation: React will not re-render if state is mutated directly without using setState or the setter function from useState.
Explanation: Props can be made optional by setting default values directly or using defaultProps.
Explanation: React uses 'key' to identify which items in the list are changed, added, or removed.