-
Notifications
You must be signed in to change notification settings - Fork 0
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 #1
Conversation
@@ -1,4 +1,5 @@ | |||
module.exports = { | |||
preset: 'ts-jest', | |||
testEnvironment: 'jsdom', | |||
testRunner: 'jest-jasmine2', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -14,6 +14,8 @@ import * as React from 'react'; | |||
import { Simulate } from 'react-dom/test-utils'; | |||
import { reactular } from './reactular'; | |||
|
|||
const wait = () => new Promise(resolve => setTimeout(resolve, 10)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an alternative to using act
which I couldn't use because Jest thinks we're not in a React environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a few small suggestions
"react": "^16.9.0 || ^17.0.0", | ||
"react-dom": "^16.9.0 || ^17.0.0" | ||
"@types/react": "^18.0.0", | ||
"react": "^18.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big deal at all, but would these changes be compatible with React 16 or 17? I'm guessing not, but just double-checking.
I'm not sure if anyone else actually uses this package, but it could be nice to allow older versions if it's not a burden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new Root API is React 18 only unfortunately. If we leave things as they are and use render
, React will just behave as if its running React 17.
Upgrading to React18 and bumping dependencies as well.