Skip to content

Fixes #21 - uses RecoilRoot's built-in state initialization instead of dynamically-created "state-setter components" #22

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kylegoetz
Copy link

@kylegoetz kylegoetz commented Nov 27, 2021

The dynamically-created state-setter components in this lib do not always initialize state before the hook-under-test executes, which causes tests to fail unpredictably. The state-setter components are not true state initializers for this reason.

By using RecoilRoot's built-in state initialization, we guarantee the state is predictable before any hook-under-test executes.

If accepting this PR, accept from the second-to-last commit, as the final commit is the code built into dist so my project can use the lib with this bugfix until the PR is accepted and deployed to npm.

Edit The topology of the API does not change at all. We only use RecoilRoot's state initialization prop under the hood with no change from the perspective of a user.

kylegoetz and others added 3 commits November 27, 2021 00:45
… custom state setters that sometimes fire too late to be true initailizers
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.

1 participant