Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): sync jotai renders with useState renders (#827) #841

Merged
merged 5 commits into from
Nov 24, 2021

Conversation

Aslemammad
Copy link
Member

@Aslemammad Aslemammad commented Nov 19, 2021

fix #827
it turns out this is the proper fix. (there was a misunderstanding with useReducer behavior.)

@vercel
Copy link

vercel bot commented Nov 19, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pmndrs/jotai/8ZwevcWVn2HgvFoZckhgTeQhwCCD
✅ Preview: https://jotai-git-fork-aslemammad-fix-827-pmndrs.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 19, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a1ba503:

Sandbox Source
React Configuration
React Typescript Configuration
React Browserify Configuration
React Snowpack Configuration
Next.js Configuration
Next.js with custom Babel config Configuration
React with custom Babel config Configuration

@dai-shi
Copy link
Member

dai-shi commented Nov 23, 2021

https://codesandbox.io/s/jotai-useatom-issue-forked-u2l35?file=/src/App.js
the codesandbox example is also fixed. cc @hannojg

@dai-shi dai-shi added this to the v1.4.5 milestone Nov 23, 2021
@dai-shi dai-shi merged commit f315f87 into pmndrs:main Nov 24, 2021
@dai-shi dai-shi changed the title feat: sync jotai renders with useState renders (#827) fix(core): sync jotai renders with useState renders (#827) Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing atom in useAtom returns previous atom's value once before returning the new atom's value
2 participants