sweetalert2 / sweetalert2-react-content

Official SweetAlert2 enhancer adding support for React elements as content
MIT License
701 stars 48 forks source link

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

Closed mifi closed 2 years ago

mifi commented 2 years ago

5.0.1

Not sure why it's happening, because looking at the source it seems correct: https://github.com/sweetalert2/sweetalert2-react-content/blob/aa8d14b6a9c8506235771e6dec07635551fae632/src/index.js#L2

however looking at the dist from npm, it seems to be doing it incorrectly, so maybe something went wrong in the build process:

inside node_modules/sweetalert2-react-content/dist/sweetalert2-react-content.es.js:

/** @preserve
  * package: sweetalert2-react-content v5.0.1
  * file: dist/sweetalert2-react-content.es.js
  * homepage: https://github.com/sweetalert2/sweetalert2-react-content#readme
  * license: MIT
  **/

import React from 'react';
import require$$0 from 'react-dom';

var createRoot;

var m = require$$0;
{
  createRoot = m.createRoot;
  m.hydrateRoot;
}
limonte commented 2 years ago

Thank you @mifi for the detailed investigation, there was indeed an issue in the build config.

limonte commented 2 years ago

:tada: This issue has been resolved in version 5.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: