Live data from Hacker News

UseHooks – A Collection of Server Component Safe React Hooks

usehooks.com

21–30 of 62 posts

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

#21
I don’t understand why this should be distributed as a package of many hooks.

Unless if a hook is unusually complicated, I much rather copy-paste it into my code.

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.

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

#22

I don’t understand why this should be distributed as a package of many hooks. Unless if a hook is unusually complicated, I much rather copy-paste it into my code. 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.

Copy/pasting is fine. You do you. https://github.com/uidotdev/usehooks/blob/main/index.js

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

#23
post #12

How telling is it that a basic core function like useFetch has a warning that it “depends on React’s experimental useEffectEvent”? Almost a decade later and simple data fetching is still an unsolved “problem” in React land.

The problem of data fetching is basically the problem of caching, famously one of the two hardest problems in computer science.

Whats the other one ?

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

#24

I don’t understand why this should be distributed as a package of many hooks. Unless if a hook is unusually complicated, I much rather copy-paste it into my code. 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.

Copy/pasting is fine. You do you. https://github.com/uidotdev/usehooks/blob/main/index.js

I understand the source is available. I’m saying I would enjoy seeing the source on the website as I browse it. Much easier to search up on Google that way.

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

#26
post #23
post #12

Earlier quoted context omitted.

The problem of data fetching is basically the problem of caching, famously one of the two hardest problems in computer science.

Whats the other one ?

naming things and off-by-one errors

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

#27

I don’t understand why this should be distributed as a package of many hooks. Unless if a hook is unusually complicated, I much rather copy-paste it into my code. 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.

I think that boat has sailed with javascript. I don't understand why leftpad is a module but much of the community disagrees with me on that.

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

#28

Earlier quoted context omitted.

Copy/pasting is fine. You do you. https://github.com/uidotdev/usehooks/blob/main/index.js

I understand the source is available. I’m saying I would enjoy seeing the source on the website as I browse it. Much easier to search up on Google that way.

You realize that is a website you can browse. Having it on another domain doesn't make your search easier on google.
Post reply on HN