Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
commit: |
|
Size Change: -86.9 kB (-82.77%) 🏆 Total Size: 18.1 kB 📦 View Changed
|
* [v3] drop old node * fix test * fix again
* [v3] drop rollup * strict module * some fixes
* [v3] drop old React * fix ci test
* [v3] redesign buildingBlocks * use key constants for better readability
|
/ecosystem-ci run |
Ecosystem CI Output |
| rerender() | ||
| value = store.get(atom) | ||
| } | ||
| useEffect(() => store.sub(atom, rerender), [store, atom]) |
There was a problem hiding this comment.
There is a slight behavioral difference in useAtomValue between v2 and v3. I'm not sure if this is intentional or could cause an issue.
// before (in useAtomValue)
useEffect(() => {
const unsub = store.sub(atom, () => {
// ...
rerender()
})
rerender() // <-- rerender was called on mount
return unsub
}, [store, atom, delay, promiseStatus])
// after (in useAtomValueRaw)
useEffect(() => store.sub(atom, rerender), [store, atom])In v2, rerender() was explicitly called on mount, whereas in v3 it seems to only be triggered by the subscription.
There was a problem hiding this comment.
This is intentional and documented.
There was a problem hiding this comment.
Yes, this is intentional and one of the biggest reasons for the major bump. Suggestions are welcome to improve the docs.
There was a problem hiding this comment.
I can't open a PR myself (locked to collaborators), so here's an attempt to better explain the differences between the three hooks: https://github.com/pmndrs/jotai/compare/v3...Wendystraite:jotai:v3_docs?expand=1
|
@arjunvegda Could you work on migrating jotai-devtools? |
|
/ecosystem-ci run |
Ecosystem CI Output |
|
/ecosystem-ci run |
Ecosystem CI Output |
|
/ecosystem-ci run |
Ecosystem CI Output |
* doc: explain loadable deprecation in v3 doc * doc: explain differences between atom hooks * doc: reword useAtomValueRaw return value explanations Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com> --------- Co-authored-by: Wendy FOUCHTER <wendy.fouchter@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.