jonatanklosko / material-ui-confirm

Simple confirmation dialogs built on top of @mui/material and straightforward to use thanks to React Hooks
https://www.npmjs.com/package/material-ui-confirm
MIT License
339 stars 58 forks source link

Incompatible with React 18/Nextjs? #106

Open tstiemerling opened 2 months ago

tstiemerling commented 2 months ago

Using nextjs 14:

    "next": "^14.2.4",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",

Getting:

TypeError: (0 , react__WEBPACK_IMPORTED_MODULE_0__.createContext) is not a function at eval (webpack-internal:///(rsc)/./node_modules/material-ui-confirm/dist/material-ui-confirm.esm.js:139:87) at (rsc)/./node_modules/material-ui-confirm/dist/material-ui-confirm.esm.js

jonatanklosko commented 2 months ago

I don't have Next.js expertise, but you may be missing "use client"; in the file where you wrap your app in <ConfirmProvider>.