In React there can be two type of reusable components functional component and class components. Class components have it's on state management features along with lifecycle methods.
In the mean time functional component which meant to smaller usage and they don't have state management option, for that you may depend on props.
Hooks
Hooks brings all class features to functional components.
Hooks are Javascript functions which accept and return functions and objects. In React there are inbuild hooks. useState , useEffect etct are few of them. We can also create custom hooks, most of the libraries does have hooks.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.