Zustand v4.5.0 is released! Docs for the new feature are work in progress. I also published the first alpha version for v5. Please try it and report what you find. v5 doesn't add any new features, just drops some, and becomes much smaller.
We are thrilled to announce Jotai v1, a
@ReactJS
state management library. This is the outcome of last ten month work.
Visit 👉
and find cute jotai mascot! 👻
Today is the day when my first book is published: Micro State Management with React Hooks: Explore custom hooks libraries like Zustand, Jotai, and Valtio to manage global states
So happy to finally have it done!
Announcing
@excalidraw
-animate! You can animate your drawing and export it to a movie file!
Repo 👉
Example 👉
Current status: Experimental, basic feature complete.
🎉 Happy to announce the initial stable release of valtio, a proxy-state library for
@ReactJS
.
GitHub 👉 💊
Please feel free to open issues / discussions for questions.
Zustand v4.5.0 is released! Docs for the new feature are work in progress. I also published the first alpha version for v5. Please try it and report what you find. v5 doesn't add any new features, just drops some, and becomes much smaller.
With upcoming Jotai v2, you can read/update atom values outside React. Check out this counter example. This is called v2 API and already pre-released in jotai v1.11.0.
CodeSandbox:
For about a month, my
@excalidraw
development was mainly refactoring and fixing subtle (but not trivial!) bugs, but today I made a progress. 🎉
Now, you can resize multiple elements with curved lines. Try the behavior with the preview URL in the PR.
⛩ New Blog Post: Introducing Waku, the minimal React Framework that enhances React Server Component (RSC) usage. Perfect for RSC enthusiasts or those curious about Waku.
For detailed info and examples, check out our GitHub repo. Learn more here 👉 🤩
Facebook's Sapling just made the switch from Recoil to Jotai:
There must be various techniques behind it! We'd love to hear from those who've also migrated from
@RecoilJS
to
@JotaiJS
. Please share your experiences and insights with us!
🎉Happy to announce Zustand v4!
Thanks so much for those contributing to code and docs, and reporting issues and questions.
v4 is not breaking for JS users. For TS users, basically migrate to `create<MyState>()(...)` syntax. Please carefully read docs.
Introducing Waku “pages router”! 🎉
We’re excited to bring a minimal file-based router API to the modern React era. Waku is now the fastest way to start building with server components.
Learn more 👉 ⛩️
When teaching how to use `useEffect` in
@ReactJS
, I say we should assume an effect function will be executed after 10 seconds. If that causes a serious problem, the usage is probably wrong.
We might be able to make it a DEV-only util. (Timing with multiple ones is not supported.
Guess what Valtio can easily do, but Zustand can't. Valtio can subscribe to deep nested objects. This demo shows infinite tree structure with optimized renders. The code is surprisingly small.
We've explained the difference is basically coding style, but this is capability diff.
Look at this Ping-pong game. This is a r3f example, whose game state is converted from zustand to valtio.
Valtio is a proxy-based state manager that works pretty much like normal JavaScript objects.
Check it out:
Demo:
Just published a course about jotai/xstate!
Jotai is an atomic state manager to avoid extra re-renders in React.
XState is a framework-agnostic method to define state machines/statecharts.
Their goals are orthogonal. Wouldn't it be neat to combine them?
I just updated excalidraw-animate!
If you are an
@Excalidraw
user who has never tried this tool, please give it a try, it must be fun at least.
An example 👇
Zustand users often face challenges with the slice pattern. Introducing zustand-slices! This is just a start. I'm eager to hear your feedback and would welcome any contributions. Let's make it better together!
Repo 👉
Demo 👉
🎉Announcing a new project: Katachidraw
Highly inspired by
@Excalidraw
, but not to conflict, this is an SVG-based drawing tool. No HTML/CSS.
Tool:
GitHub:
Built with 👻
Embeddable in React Native (& Web)
Let me repeat this. My perspective on
@pmndrs
three state managers.
zustand is small, predictable, no magic.
valtio is easy, intuitive, magical.
jotai is familiar, creative, fun.
zustand v4.0.0-rc.1 is released.
zustand is a very small state manager for
@ReactJS
.
To prove how small it is, here's a screenshot of the core library.
See:
-
-
🐻
Did you know? useReducer and useState behave differently in React 18. So, preferring useState that can optimize more makes sense when useReducer isn't necessary. useState works for most cases even with _reducer_ 😉.
🎉 "waku-waku" excited to announce Waku v0.10.0! 🎉
It's a React framework with Vite for React Server Components. We are trying to develop a production-level framework and your feedback would be very important.
Jotai atoms are primarily for bottom-up approach, but it can do top-down approach like zustand. So, I created a ToDo app with a single store with jotai. As a bonus, it uses atomWithHash, so the state is persisted in the URL.
Demo👉
Monetizing OSS is difficult by nature, but I hope people will pay if they find a value. It's more meaningful to pay for a content, instead of tipping for OSS. So, I decided to challenge. This is my first paid content to teach the library code, Zustand.
Yay! This is my 3rd tool with
@Excalidraw
, called Excalidraw-Claymate. Unlike -Animate, this is to create anime GIF from snapshots. Look forward to someone create something with it.
Repo 👉
Tool 👉
Experimental but please try it
Hello zustand users! Finally v4 is released. It's RC, but nothing is left. We just need feedbacks.
This is basically backward compatible in JS. Some deprecated features are dropped thus the major version. TS types are rewritten and have breaking changes.
At Poimandres, we develop three state managers for
@ReactJS
: zustand, jotai, and valtio.
valtio is least known among the three. Because we want more people to know it, we created a dedicated website! This is done by valtio website team!
Visit 👉 💊
🎉 Jotai and XState integration is here 🎉
The first iteration in jotai v0.14.4 comes with `atomWithMachine`, which is like useMachine. Can use it as a normal atom. Tell me what you build with it.
GitHub:
Demo: by
@DavidKPiano
👻
This sounds huge to me. There has been a big misconception in the community (including myself in the past). We've been using ref weirdly only to avoid false positives.
In the same category, there are useLayoutEffect warning and array index key fallback...
Zustand is such a small library that I don't have much to teach. Maybe I can just randomly talk about Zustand v4. Here's a new video product. Hope someone finds it interesting.
👉 🐻
Often, I hear people like Zustand for less boilerplatey code. Zustand is also less code in its implementation. For me as a library author, it's almost _nothing_. It's interesting and counter-intuitive that less code achieves less boilerplates.
FYI: 🐻
Have you tried
@Excalidraw
-Animate yet? It produces a _portable_ SVG with animation, which you can embed in your web site. Try it out:
The trick is to use the <object> tag. The <img> tag doesn't work for custom fonts.
Valtio may seem to work like magic, but it's based on a simple rule. If you are interested in the internals, here's a simplified version. Hope this is fairly readable.
My long journey to add group resizing feature in
@Excalidraw
finally ends.
Did you know this is not possible now? This PR fixes it at last. It was tricky to implement If you are eager to help, please open the preview in the PR, and try finding bugs.
Re: suspense for data fetching
Does this diagram help? It is a tweet of mine more than two years ago:
It doesn't take account the waterfall issue with Suspense. I wasn't aware of it back then. We should basically prefetch everything at the same time.
🎉 Announcing a new experimental project: React Worker Components
Everyone is excited about Server Components. So am I. This is to explore a possibility to apply the idea for Web Workers. The basic implementation is ready to play with. Check out examples!
🤩Waku v0.19 is here, just a month after v0.18. Our React Framework supporting RSC now comes with a major shift: we're expanding our focus from library authors to app developers! A new router API marks our first big step in this direction.
Learn more👉 ⛩️
Isn't this exciting?
I started developing a React framework to experiment React Server Components. As there is a demand for RSC framework alternative to Next.js, I'm putting more efforts to make it a production-level framework. So, I decided to rename it.
Am I going crazy? A bit inspired by
@solid_js
, my latest experiment is to run full jotai app without react. No reconciliation, just atomic updates.
Spent a couple of hours to create a PoC. It's very new field for me. Any insights?
🎉 Super excited to announce the release of Waku v0.21, which comes with full Server Actions support! Waku, the minimal React framework built for RSC, now offers complete RSC capabilities.
Check out the announcement article 👉 ⛩️
Yay! Here's a new project from Jotai Labs, "jotai-trpc" a binding for
@trpcio
!
👉
The example can't run with client-only codesandbox (does anyone know any public tRPC server for demo?), so here's the code how it's used. 👇
Now, signal() with zustand-signal (internally create-react-signals) supports react-three-fiber!
It updates the position of cube without React rendering. Would be good for game-like apps.
Demo:
Note: This project is still experimental and includes hacks.
If you are using Jotai (or maybe Recoil) and run into limitations when creating atoms with props, consider checking out jotai-molecules. It allows you to create more complex states for your app.
Another advice of mine is, when you use `useEffect`, make it work without "deps" at first. Add "deps" later for _optimization_. Don't expect "deps" to work with semantic guarantees.
When teaching how to use `useEffect` in
@ReactJS
, I say we should assume an effect function will be executed after 10 seconds. If that causes a serious problem, the usage is probably wrong.
We might be able to make it a DEV-only util. (Timing with multiple ones is not supported.
Decision Tree to Choose a Global State Library
I'm maintaining several libraries and I can explain the differences. It's hard to recommend one. So, I
@excalidraw
the decision tree.
It turns out it's hard to express as a tree. This is rather just FYI.
🤩 Excited to announce Waku v0.20.2! Waku is the Minimal React Framework with first-class RSC support. A few new contributors have joined us, fixed some bugs, and improved use cases, such as SSG. I think it’s now pretty solid for SSG.
⛩️
This is a diagram to show technical differences among
@ReactJS
libraries for global state which I maintain/develop. I feel like keeping posting this kind of tweets, but every time it's slightly changed.
🎉 Exciting news! Jotai Effect has officially reached v1! This long-awaited feature is now finally ready for production use. A huge thanks to
@DavidMaskasky
for their incredible work. Check out the release post: 👻
My perspective comes from a slightly different angle. Zustand is a good abstraction from useState. If people find that it works for them, it probably means they have misused or overused redux from the start.
instead of adding more layers of abstraction to hide previous layers, zustand did the reverse. it unpeeled unnecessary abstraction: for instance actions, action-types, "thunks". the beautiful essence of redux is what's left in this screenshot — simplicity always wins.
As React Query won, and with React 19 landing soon, I decided to deprecate one of my old projects. Thanks for your interest and support. It was a long journey, but my focus on data fetching is now on Waku.
At a glance:
- zustand looks like redux, but you know it's not at all.
- jotai looks like recoil, but you may feel it different afterward.
- valtio looks like mobx, but you will find the overlap is little.
What's signal? 🤔 Whatever it is, here's `jotai-signal`.
Still an experimental project, but you can play with it. It uses `experimental_use` internally and only works with React experimental build.