allow configuring custom fiber, add missing createContainer arguments #534
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.
I realize you're probably not very interested in changes to the v7 version with v8 likely being on your mind, but here are some changes that were useful to me and may be to others.
Description of change
The changes allow users to create a Fiber with a custom reconciler config, useful when you want some tighter
control over certain react internals (like for instance passing async work through a custom scheduler).
For existing users nothing changed, but those who want the added control now access to the internals needed to accomplish it.
I also added some missing arguments to
createContainer
. On a recoverable error, React would try to call the undefined error handler function, causing another error and not reporting the initial error to the user.Here's a basic example of how to create a custom fiber:
And here's how to write a helper function
createFiber
that will integrate with dev tools and play nicely with hot reloads:Pre-Merge Checklist
npm run lint
)npm run test
)