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

Use ReactDOM.createRoot instead of ReactDOM.render #238

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ZeroIntensity
Copy link

Description

ReactDOM.render is deprecated as of React 18 (see here), and removed in React 19 (see here). This switches to the alternative, ReactDOM.createRoot(...).render(<Root />).

Checklist

Please update this checklist as you complete each item:

  • Tests have been developed for bug fixes or new functionality.
  • The changelog has been updated, if necessary.
  • Documentation has been updated, if necessary.
  • GitHub Issues closed by this PR have been linked.

By submitting this pull request I agree that all contributions comply with this project's open source license(s).

@ZeroIntensity ZeroIntensity requested a review from a team as a code owner June 2, 2024 18:42
@Archmonger
Copy link
Contributor

Looks like this change broke the testing suite.

Maybe the ReactJS version needs to be bumped to support this?

@ZeroIntensity
Copy link
Author

Could be, but looking at the package lock, it seems to be in React 17, so it should support this. I'm not sure how the testing suite it set up, but createRoot supposedly takes control of the DOM node somehow. Perhaps that's screwing things up?

@ZeroIntensity
Copy link
Author

Scratch that - createRoot was added in React 18, not 17, so yeah, it's the version.

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

Successfully merging this pull request may close these issues.

2 participants