Fixes #21 - uses RecoilRoot's built-in state initialization instead of dynamically-created "state-setter components" #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.