Skip to content

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

Open
@durgabhupathi

Description

@durgabhupathi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions