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.
This is still a WIP branch, but the library now works properly with React 18, both in
createRoot
andhydrateRoot
modes, andStrictMode
too.I had to refactor some of the logic to not leverage anymore on the placeholders re-rendering, as if that happens R18 hydration process bails out and goes back to fallback (related issue ).
This actually poses an interesting dilemma, as our controlled phases are in reality discouraged by React team itself, as they poses risk of broken hydration if context data (for instance) changes before hydration occurs.
So I think it might be beneficial to resume the work on #73 and migrate to that so we shorten the time for afterPaint to click in.
Anyway, I'm planning to backport some of the changes (for instance StrictMode support, examples, subscriptions refactor, ...) to the current branch so the diff here will become much smaller and manageable.
Lastly, I'ver dropped from this branch support for React 17 and lower. We could to either publish this as v2 (only R18+ compatible) or keep the old code in branches by detecting older versions of React. What do you think?
Todo: