Hacker News new | ask | show | jobs
by aelzeiny 1205 days ago
> Don't use those...then an additional 4.9% can be handled with jotai...

Needing Jotai on top of React's defacto state management is the issue. TFA talks about an ecosystem of libraries that attempt to fix React's shortcomings. Pure React does have undeniable shortcomings like proper, non-brittle routing.

3 comments

Jotai is literally like a single file.

Here's a video on how to use Jotai by writing your own in minutes: https://youtu.be/gg31JTZmFUw

Jotai may be small and focused, but is definitely not a single file: https://github.com/pmndrs/jotai/tree/main/src/
Yes, sorry my bad, the project isn't a single file. I was just talking about the implementation.
They intentionally didn't provided that to let the ecosystem explore different solutions.
I agree with you about routing. Something so core about building web apps should be treated as a first class citizen of the ecosystem.

I don't think jotai adds a lot of complexity though, and like I said most of the time you don't need it. It just makes syntax a bit nicer to read and write, but you could do it with context if you really wanted to.