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 18 createRoot in index.js #839

Open
sammyjava opened this issue Dec 7, 2022 · 1 comment
Open

Support React 18 createRoot in index.js #839

sammyjava opened this issue Dec 7, 2022 · 1 comment

Comments

@sammyjava
Copy link
Member

I find that I have to stick with the React 17 method of rendering the RootContainer for my tools to work in BG. Since Progress is Good, I'd like to be able to use the React 18 createRoot method as suggested by the warning:

Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot

FWIW the demo works fine with createRoot, but integration into BG fails with an "Object() ... is not a function" error.

@heralden
Copy link
Member

heralden commented Feb 5, 2023

Looks like this is supported in reagent: https://www.metosin.fi/blog/reagent-towards-react-18/

Seems like a simple case of updating BG's React and Reagent and changing to use reagent.dom.client. The same change would likely also have to be done to all the tools, to use createRoot instead, which unfortunately breaks compatibility with older versions. Maybe the tool integration code has to be updated as well: https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html

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

No branches or pull requests

2 participants