From today onwards I am going to share some information about React hooks. #8DaysOfReactHook
So this is the #1stDayOfReactHook and in this post, I have discussed what and why of React Hooks. also, what are the different types of the hook?.
Hooks were introduced in React version 16.8. Hooks are functions that help us to manage State and mimic lifecycle feature from a functional component.
Previously Functional Components were called Stateless and only class components were used for state management and lifecycle methods. if we want to manage some state we have to convert the functional component to class component this led us to the development of the hook.
- Call hooks from the functional component
- Don't call hooks from the class component.
- Don't call hooks from loops and nested function.
From the next day will break down each hook one by one, so stay connected.
If I have missed 😀something please let me know in the comment section
Thank You 😊 For Reading.