Live data from Hacker News

UseHooks – A Collection of Server Component Safe React Hooks

usehooks.com

1–10 of 62 posts

Re: UseHooks – A Collection of Server Component Safe React Hooks

#2
Hi everyone!

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.

Hope you all enjoy!

Re: UseHooks – A Collection of Server Component Safe React Hooks

#3

Hi everyone! 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. Hope you all enjoy!

Are all the hooks on the site made by ui.dev?

It'd be great if each hook linked to the Github code for that hook, as the first thing I thought of was (a) what is the hook doing, and (b) is it easier to adapt my existing hook and reduce the number of dependencies I have to track?

Re: UseHooks – A Collection of Server Component Safe React Hooks

#4
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.

[0] https://github.com/xnimorz/use-debounce

Re: UseHooks – A Collection of Server Component Safe React Hooks

#5
post #3

Hi everyone! 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. Hope you all enjoy!

Are all the hooks on the site made by ui.dev? It'd be great if each hook linked to the Github code for that hook, as the first thing I thought of was (a) what is the hook doing, and (b) is it easier to adapt my existing hook and reduce the number of dependencies I have to track?

https://github.com/uidotdev/usehooks/blob/main/index.js

Re: UseHooks – A Collection of Server Component Safe React Hooks

#6
post #3

Hi everyone! 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. Hope you all enjoy!

Are all the hooks on the site made by ui.dev? It'd be great if each hook linked to the Github code for that hook, as the first thing I thought of was (a) what is the hook doing, and (b) is it easier to adapt my existing hook and reduce the number of dependencies I have to track?

Good feedback. Yes they're all up on Github – https://github.com/uidotdev/usehooks

Re: UseHooks – A Collection of Server Component Safe React Hooks

#7
post #4

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…

That's good feedback. Thank you.

Re: UseHooks – A Collection of Server Component Safe React Hooks

#8

Hi everyone! 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. Hope you all enjoy!

I see "MIT" in package.json - could you add a proper license file to the repo?

Re: UseHooks – A Collection of Server Component Safe React Hooks

#10

Hi everyone! 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. Hope you all enjoy!

Was this inspired at all by VueUse? After the windicss/tailwind and Remix/Next.js scuffles it's become clear that it's good to get acknowledgement.

Either way, I hope it's as well documented and well maintained as VueUse. That has been pretty sweet. I wanted something like it for React a few months ago and useHooks was the closest thing I found but not nearly as good. Hopefully this relaunch will be.

Post reply on HN