Skip to content

控制台报错:Warning: You are importing createRoot from "react-dom" which is not supported. You should instead import it from "react-dom/client". #29

@MidnightCrowing

Description

@MidnightCrowing

如题
codesandbox:https://codesandbox.io/p/sandbox/969m5x
Image

经测试,该问题与Toast有关,每显示一次Toast都会有新报错产生
怀疑与\src\components\toast\index.tsx有关:

const toast = (option: toastType) => {
  const jolPlayerToast = document.querySelector('#jolPlayerToast');
  if (!jolPlayerToast) {
    const container = document.createElement('div');
    container.id = 'jolPlayerToast';
    document.querySelector('#JoL-player-container')!.appendChild(container);
    const root = createRoot(container);
    root.render(<Toast {...option} />);
  }
};

但不知道该怎么修😅

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions