Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 2.21 KB

README.md

File metadata and controls

23 lines (16 loc) · 2.21 KB

React-Hook-Fundamental

learn more about react hook in depth and how all the important modules in react work

useState Hook

useState Hook allows us to track state in a function component. State generally refers to data or properties that need to be tracking in an application.

useEffect Hook

useEffect is a hook for encapsulating code that has 'side effects,' and is like a combination of componentDidMount, componentDidUpdate and componentWillUnmount. Previously, functional components didn't have access to the component life cycle, but with useEffect you can tap into it.

useContext Hook

useContext hook is used to create common data that can be accessed throughout the component hierarchy without passing the props down manually to each level.

useReducer Hook

useReducer is a React Hook that provides a way to manage state and perform state transitions in a React function component. It is similar to the redux library in that it allows you to centralize and manage the state of your application in a single location.

useCallback Hook

useCallback is a hook that will return a memoized version of the callback function that only changes if one of the dependencies has changed.

useMemo Hook

useMemo Hook allows you to optimize performance by memoizing a function's results. It helps to avoid re-rendering of a component when the inputs of a certain function have not changed.

useRef Hook

useRef Hook allows you to access the value of a DOM element or a state value across render cycles. It's commonly used to store a reference to an element in the DOM so that it can be manipulated, or to store a value that persists across render cycles.