I think it's great to have a repo of all the hooks, but I wonder if implementing each from scratch is the right approach. For example, there is an exceptional useDebounce package [0] that handles many more cases than the simplified one on UseHooks, and I think it could be even more useful to highlight exceptional work that has already been done and maintained in the community rather than in-housing everything. I also think there is more potential in that approach to further React as a whole as the community converges on agreed-upon utilities that become so integral to the way people write and discuss code they make it into the core library.<p>[0] <a href="https://github.com/xnimorz/use-debounce">https://github.com/xnimorz/use-debounce</a>
Hi everyone!<p>You old heads may remember the original usehooks. It was built when hooks were first released in 2019. We just rebuilt it from scratch, added about 40 more hooks, made it compliant with Server Components, and launched it as a standalone lib.<p>Hope you all enjoy!
Nicely done!<p>Dumb question, but as someone who is aware of server components but hasn't used it, what makes a hook “server component safe”? I assume it doesn't necessarily mean that you can use it on the server (e.g. useMouse), but that if you use it it will not break server-side rendering or complain about a DOM diff?
How telling is it that a basic core function like useFetch has a warning that it “depends on React’s experimental useEffectEvent”?<p>Almost a decade later and simple data fetching is still an unsolved “problem” in React land.
How do these compare with the current heavyweight library?<p><a href="https://github.com/streamich/react-use">https://github.com/streamich/react-use</a>
I saw `useDebounce` and thought "what the hell does debounce have anything to do with react render cycle?". When I check the code, `useDebounce` does... I don't even know what it does, delayed set state?<p><a href="https://github.com/uidotdev/usehooks/blob/380e83fa267157832e9a312b8dd9847e0e6a0f65/index.js#L225">https://github.com/uidotdev/usehooks/blob/380e83fa267157832e...</a>
I don't know if I'm being silly, but I'm trying to find the source behind useLocalStorage<p><a href="https://usehooks.com/uselocalstorage" rel="nofollow">https://usehooks.com/uselocalstorage</a><p>On their main website Nada, within the github, searching for it only turns up the docs implementation and not the actual source?
The landing page has 'useFetch' in the list but they're actually in the experimental branch. I personally think they should be removed from the landing page or somehow marked to let the users know they're only available at the experimental release.
I don’t understand why this should be distributed as a package of many hooks.<p>Unless if a hook is unusually complicated, I much rather copy-paste it into my code.<p>You should really share the implementations of each of them on the website. I don’t want to pull in 100 hooks just because I don’t want to write 1 from scratch.