Skip to content
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

Support React 17 #147

Merged
merged 3 commits into from
Jan 15, 2021
Merged

Support React 17 #147

merged 3 commits into from
Jan 15, 2021

Conversation

christopher-stripe
Copy link
Contributor

This PR upgrades the react and react-dom development dependencies, and specifies that we now support React 17 in the peerDependencies.

React 17 changes the timing of when effects are cleaned up. This caused one of our tests to break, since it was synchronsly asserting that element.destroy was called when an Element component was unmounted. To fix the test, I needed to upgrade our @testing-library/react dependency to at least 10.4.7, which ensures that effects are flushed synchronously when unmount is called in a test. I also upgraded a few related deps, just to keep us up to date.

A different test failed due to the additional Concurrent Mode changes in React 17. As before, Concurrent Mode is proving to be too unstable to reliably support without breaking changes, so I've disabled this test.

All tests are now passing, and I did a quick smoke test in a sample React 16 and React 17 app.

@christopher-stripe
Copy link
Contributor Author

christopher-stripe commented Jan 7, 2021

Looks like the RTL upgrade uses some new TypeScript 3.8 syntax, which is causing the typechecking to fail. I'll fix this and reassign.

@christopher-stripe christopher-stripe removed the request for review from dweedon-stripe January 7, 2021 19:53
if (elementRef.current) {
elementRef.current.destroy();
React.useEffect(() => {
const element = elementRef.current;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was recommended but not actually necessary. Made it in case it prevents any future bugs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants