Blogs

Question Answer Page

a. When should you use context API?

Ans: Context API allows to pass data through a component tree, it works without pass props down manually and easier to share data between components.

b. What is a custom hook?

Ans:It allows you to reuse stateful logic across multiple components. It's powerful feature for extracting logic that is typically used by multiple components and turning it into a reusable function.

c. What is useRef?

Ans: useRef is a kinds of hook that returns a mutable ref object. It is used to stored a value or a reference to a component or DOM element. It doesn't affect the rendering of the component, or for accessing and modifying DOM elements directly.

d. What is useMemo?

Ans: It a hook that allow to memorize the result of a function. It has dependencies that changed when recomputed. It's really useful for avoid re-computations and improve perpormance.