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 useImmediateState for React Native #358

Merged
merged 2 commits into from
Aug 1, 2019
Merged

Fix useImmediateState for React Native #358

merged 2 commits into from
Aug 1, 2019

Conversation

kitten
Copy link
Member

@kitten kitten commented Jul 31, 2019

The ssr check was failing on React Native since it was kind of aggressive. I don't really want to even have it or useLayoutEffect in place, but multiple React threads didn't really resolve concerns that have been raised with it. Even react-redux uses it in this way.

I tried to find an alternative solution, but it turns out that useState(s => s) which would be firing at a similar time still triggers an update.

I've left a link to react-redux's repo since they're likely also be looking out for a solution to this problem.

Also leaves a note to react-redux, since they'll likely
be looking out for an alternative solution as well
@kitten kitten requested a review from kelset July 31, 2019 17:13
Copy link

@kelset kelset left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚛️💞

@kitten kitten merged commit 3bee822 into master Aug 1, 2019
@kitten kitten deleted the fix/detect-rn branch August 1, 2019 09:42
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.

2 participants