useMount
kitten-s opened this issue · 3 comments
kitten-s commented
It will cool to add useMount hook that behaves as oncomponentdidmount. Because it is more simple to read than useEffect(fn, []);
sandiiarov commented
You can build it on your own.
function useMount(mount) {
React.useEffect(mount, []);
}
3imed-jaberi commented
@kitten-s , you can use this npm pkg (use-lifecycle-hooks), if this approach it's more comfortable for you.
gaearon commented
Hi, thanks for your suggestion. RFCs should be submitted as pull requests, not issues. I will close this issue but feel free to resubmit in the PR format.