react-mui-scheduler icon indicating copy to clipboard operation
react-mui-scheduler copied to clipboard

Package Not Working. Installed from NPM.

Open MUK-Dev opened this issue 4 years ago • 3 comments

I just copy pasted the code given in the documentation

Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
    at resolveDispatcher (main.3d5c697028c51d59c3da.hot-update.js:35350:17)
    at useState (main.3d5c697028c51d59c3da.hot-update.js:35380:24)
    at Scheduler (main.3d5c697028c51d59c3da.hot-update.js:33238:66)
    at renderWithHooks (bundle.js:78836:22)
    at mountIndeterminateComponent (bundle.js:82501:17)
    at beginWork (bundle.js:83969:20)
    at HTMLUnknownElement.callCallback (bundle.js:66632:18)
    at Object.invokeGuardedCallbackDev (bundle.js:66681:20)
    at invokeGuardedCallback (bundle.js:66743:35)
    at beginWork$1 (bundle.js:89756:11)

bundle.js:81175 The above error occurred in the <Scheduler> component:

    at Scheduler (http://localhost:3000/main.3d5c697028c51d59c3da.hot-update.js:33219:22)
    at div
    at http://localhost:3000/static/js/bundle.js:4274:66
    at Grid (http://localhost:3000/static/js/bundle.js:13631:87)
    at div
    at http://localhost:3000/static/js/bundle.js:4274:66
    at Grid (http://localhost:3000/static/js/bundle.js:13631:87)
    at Dashboard (http://localhost:3000/main.3d5c697028c51d59c3da.hot-update.js:37:66)
    at RenderedRoute (http://localhost:3000/static/js/bundle.js:94649:5)
    at Outlet (http://localhost:3000/static/js/bundle.js:95004:26)
    at main
    at http://localhost:3000/static/js/bundle.js:4274:66
    at Box (http://localhost:3000/static/js/bundle.js:28901:72)
    at div
    at http://localhost:3000/static/js/bundle.js:4274:66
    at Box (http://localhost:3000/static/js/bundle.js:28901:72)
    at DashboardLayout
    at RenderedRoute (http://localhost:3000/static/js/bundle.js:94649:5)
    at Routes (http://localhost:3000/static/js/bundle.js:95098:5)
    at Router (http://localhost:3000/static/js/bundle.js:95029:15)
    at BrowserRouter (http://localhost:3000/static/js/bundle.js:93250:5)
    at InnerThemeProvider (http://localhost:3000/static/js/bundle.js:28110:70)
    at ThemeProvider (http://localhost:3000/static/js/bundle.js:27801:5)
    at ThemeProvider (http://localhost:3000/static/js/bundle.js:28130:5)
    at App

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.

Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
    at resolveDispatcher (main.3d5c697028c51d59c3da.hot-update.js:35350:17)
    at useState (main.3d5c697028c51d59c3da.hot-update.js:35380:24)
    at Scheduler (main.3d5c697028c51d59c3da.hot-update.js:33238:66)
    at renderWithHooks (bundle.js:78836:22)
    at mountIndeterminateComponent (bundle.js:82501:17)
    at beginWork (bundle.js:83969:20)
    at beginWork$1 (bundle.js:89731:18)
    at performUnitOfWork (bundle.js:88889:16)
    at workLoopSync (bundle.js:88802:9)
    at renderRootSync (bundle.js:88771:11)

MUK-Dev avatar Oct 14 '22 09:10 MUK-Dev

I am running into the same issue. Did you find the solution? It's probably a react version conflict.

FranciscoQuero avatar Nov 15 '22 07:11 FranciscoQuero

I am running into the same issue. Did you find the solution? It's probably a react version conflict.

Nope, the dev didn't respond

MUK-Dev avatar Nov 16 '22 05:11 MUK-Dev

Hello,

See #4, you must import at the beginning of your code, otherwise you will get this error. You can view the demo at https://codesandbox.io/s/relaxed-neumann-174pod?file=/src/App.js

rouftom avatar Nov 16 '22 11:11 rouftom