-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Upgrade to React 18 #2087
Merged
ThomasRoest
merged 14 commits into
styleguidist:React-18
from
ThomasRoest:20221213/react-18-upgrades
Feb 10, 2023
Merged
Upgrade to React 18 #2087
ThomasRoest
merged 14 commits into
styleguidist:React-18
from
ThomasRoest:20221213/react-18-upgrades
Feb 10, 2023
+758
−653
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6b418d1
to
7b9ac60
Compare
560e132
to
b993491
Compare
May i know what is the node js version you are using ? |
propTypes.node results in TS errors. There doesn't seem to be a good alternative ( other than making the children propTypes more strict, which could result more errors) Instead use something less restrictive (propTypes.any) for children and components.
Unmount asynchronously with setTimout https://stackoverflow.com/questions/73459382/react-18-async-way-to-unmount-root error message: Warning: Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition.
ThomasRoest
added a commit
that referenced
this pull request
Feb 10, 2023
Upgrade to React 18 * replace ReactDOM.render with createRoot in index.ts * fix new TS errors after upgrading @types * replace ReactDOM.render in Preview.tsx * replace ReactDOM.unmountComponentAtNode with root.unmount() * remove ReactDOM import * upgrade react testing library * replace deprecated React.SFC type with React.FC DefinitelyTyped/DefinitelyTyped#30364 * Fix TS errors in propTypes.children propTypes.node results in TS errors. There doesn't seem to be a good alternative ( other than making the children propTypes more strict, which could result more errors) Instead use something less restrictive (propTypes.any) for children and components. * fix TS errors, extract props interfaces with children * fix TS errors, add context types * TS fix * Fix React unmount error Unmount asynchronously with setTimout https://stackoverflow.com/questions/73459382/react-18-async-way-to-unmount-root error message: Warning: Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition. * make wrapper unmount test async --------- Co-authored-by: Thomas Roest <thomas.roest@moxio.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Upgrading to React 18