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.
Feat: Support React 18
chore: upgrade react dependencies
chore: replace ReactDOM.render with createRoot in index.ts
chore: fix new TS errors after upgrading @types
chore: replace ReactDOM.render in Preview.tsx
chore: replace ReactDOM.unmountComponentAtNode with root.unmount()
chore: remove ReactDOM import
chore: upgrade react testing library
chore: replace deprecated React.SFC type with React.FC
DefinitelyTyped/DefinitelyTyped#30364
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.
chore: fix TS errors, extract props interfaces with children
chore: fix TS errors, add context types
chore: TS fix
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.
Co-authored-by: Thomas Roest thomas.roest@moxio.com