Q11. When to use a Class Component over a Function Component?
After the addition of Hooks(i.e. React 16.8 onwards) it is always recommended to use Function components over Class components in React. Because you could use state, life...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (454 available).
After the addition of Hooks(i.e. React 16.8 onwards) it is always recommended to use Function components over Class components in React. Because you could use state, life...
Pure components are the components which render the same output for the same state and props. In function components, you can achieve these pure components through memoiz...
_State_ of a component is an object that holds some information that may change over the lifetime of the component. The important point is whenever the state object chang...
_Props_ are inputs to components. They are single values or objects containing a set of values that are passed to components on creation similar to HTML-tag attributes. H...
Hydration is React attaching event handlers to server-rendered HTML. A mismatch happens when the server HTML differs from the client's first render, and React warns and r...
In React, both **state** and **props** are plain JavaScript objects, but they serve different purposes and have distinct behaviors: ### State - **Definition:** State is a...
Below are some of the main differences between HTML and React event handling, 1. In HTML, the event name usually represents in _lowercase_ as a convention: ```html ``` Wh...
`SyntheticEvent` is a cross-browser wrapper around the browser's native event. Its API is same as the browser's native event, including `stopPropagation()` and `preventDe...
You can use either _if statements_ or _ternary expressions_ which are available in JS(and JSX in React) to conditionally execute or render expressions. Apart from these a...
A `key` is a special attribute you **should** include when mapping over arrays to render data. _Key_ prop helps React identify which items have changed, are added, or are...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.