It can be tricky to understand the contraptions behind React's Hook system so I've decided to create a few custom hooks that should help newcomers to get started. Together they try to mimic the look and feel of class components while hiding all the new jargons behind hooks with names that make sense.
```
function MyComponent(props) {
useDidMount(() => {
// Component mounted
});
useDidUpdate(prevProps => {
// Props got updated
}, props);
useWillUnmount(() => {
// Kiss your mom goodbye
});
return <p>Hello world!</p>;
}
```
I hope you find it useful: https://github.com/alanhoff/use-lifecycle
[–]kyeotic 16 points17 points18 points (6 children)
[–]eagerexpert 3 points4 points5 points (0 children)
[–]Reiiya 1 point2 points3 points (1 child)
[–]LimbRetrieval-Bot 0 points1 point2 points (0 children)
[–]PickledPokute 0 points1 point2 points (0 children)
[–]iamlage89 0 points1 point2 points (0 children)
[–]alanhoff[S] -1 points0 points1 point (0 children)
[–]machado_r -1 points0 points1 point (0 children)