Skip to content

Error importing ReactDOM/client #130

@paddymul

Description

@paddymul

I am trying to integrate a react component into an ipywidget.

I'm running into trouble with these lines of ts

import { createRoot } from "react-dom/client";
const root = createRoot(this.el as HTMLElement)

I get the following error in the console:

error TypeError: m.createRoot is not a function

I think the problem has something to do with webpack or tsconfig module definition but I'm not sure. I see that this repo sets libraryTarget: 'amd'. But I see no mention of AMD in most react examples I can find. Any suggestions?

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