react-packages icon indicating copy to clipboard operation
react-packages copied to clipboard

Add support for React 18

Open gunnartorfis opened this issue 3 years ago • 3 comments

As of React 18, ReactDOM.render is no longer supported. When using the library, the following warning is displayed in the console: image

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?

gunnartorfis avatar Sep 22 '22 11:09 gunnartorfis

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.

Grubba27 avatar Sep 22 '22 13:09 Grubba27

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.

gunnartorfis avatar Sep 22 '22 14:09 gunnartorfis

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.

CaptainN avatar Oct 27 '22 16:10 CaptainN

I'm closing this as this appears to have been solved. Feel free to re-open if that is not the case.

StorytellerCZ avatar Jul 31 '23 13:07 StorytellerCZ