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

Update OverlayToaster component to use ReactDOM.createRoot() for React 18 compatibility #6239

Closed
andrewkrippner opened this issue Jun 23, 2023 · 1 comment · Fixed by #6599

Comments

@andrewkrippner
Copy link

Environment

  • Package version(s): 5.0.0
  • Operating System: MacOS
  • Browser name and version: Chrome 114.0.5735.133

Steps to reproduce

Use the OverlayToaster component in a React 18 application.
Observe the console warnings about ReactDOM.render() being deprecated.

Actual behavior

The OverlayToaster component in BlueprintJS uses the ReactDOM.render() method, which is deprecated in React 18. This causes the application to behave as if it's running React 17, according to the warning message from React.

Expected behavior

The OverlayToaster component should use the new ReactDOM.createRoot() method introduced in React 18, so that it can take advantage of the new features and improvements in React 18.

Possible solution

Update the OverlayToaster component to use ReactDOM.createRoot() instead of ReactDOM.render(). This might involve refactoring the component to accommodate the new root API, which involves creating a root and then calling render on it, as opposed to the legacy API where render is called directly with the component and container.

@adidahiya
Copy link
Contributor

Thanks for the detailed issue report. Putting this on the v5.x milestone. Related: #3979

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

Successfully merging a pull request may close this issue.

2 participants