react-packages
react-packages copied to clipboard
Add support for React 18
As of React 18, ReactDOM.render is no longer supported.
When using the library, the following warning is displayed in the console:

Is this the place where the the render() call is made? If so, I'd be happy to open a PR with a fix. It would however probably mean a breaking change for those running on older versions of React, unless we can somehow check the version?
I think there will be more to it.
to this one, I guess you can use the React.version to decide how to createRoot/render not sure if this would work
function bootstrap(node, container) {
if (React.version > 18) { // pseudo-validation
return createRoot(node, container)
}
return ReactDOM.render(node, container);
}
@CaptainN has said in some issue that I could not find what was needed to support react 18. We can discuss what is needed and make a checklist to support this newer version if you want.
Gotcha. That'd be fantastic. I'm not the most experienced when it comes to this but I'd be happy to contribute in any way I can.
Let's wait for Capt's reply.
Honestly, I've never used that render template package, and just mount the react app myself using vanilla react. That package is I think for integrating with Blaze? It should be updated, if folks are using it, but I don't know much about it.
@Grubba27's suggestion looks sensible at a glance.
I'm closing this as this appears to have been solved. Feel free to re-open if that is not the case.