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

You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client".

Open durgabhupathi opened this issue 6 months ago • 1 comments

Upgraded to react-rails 3.2.1 from react-rails 2.6.2 with asset pipeline

Not calling createRoot explicitly anywhere in the code. As we are using asset pipeline no package.json/webpacker/shakapacker included in the code

Using Rails 7.2.2.1 and ruby 3.4.4

application.js looks like this

//= require jquery
//= require jquery_ujs
//= require jquery-ui
//= require bootstrap-sprockets
//= require jquery-ui/widgets/datepicker
//= require react
//= require react_ujs
//= require components
//= require_tree .

but in console see the following error message

You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client"

According to https://github.com/reactjs/react-rails/pull/1269/files this should be fixed but some how react-dom is being used instead of react-dom/client , Made sure ReactDOM.version gets 18.2.0 in browser console of applciation. Not really sure how the else part is being executed.

durgabhupathi avatar Jun 25 '25 17:06 durgabhupathi

Are you getting an error in the console or just a warning?

Judahmeek avatar Jul 28 '25 15:07 Judahmeek