shekharramola / react-wheel-of-prizes

It is a wheel of prizes game for react developers
90 stars 58 forks source link

[bug] Invalid hook call #12

Closed VityaSchel closed 3 years ago

VityaSchel commented 3 years ago

I wanted to delete spin button from canvas So i go to node modules and edit index.js but I broke it so I wanted to delete it from here and instead install this module to documents folder outside of project folder to then install to my project from here. It was hard to clean npm cache but eventually I did it and downloaded this module so I can edit it and webpack watches it but now I having this error:

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 (react.development.js:1476)
    at useState (react.development.js:1507)
    at WheelComponent (index.js:15)
    at renderWithHooks (react-dom.development.js:14985)
    at mountIndeterminateComponent (react-dom.development.js:17811)
    at beginWork (react-dom.development.js:19049)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994)
    at invokeGuardedCallback (react-dom.development.js:4056)
    at beginWork$1 (react-dom.development.js:23964)
    at performUnitOfWork (react-dom.development.js:22776)
    at workLoopSync (react-dom.development.js:22707)
    at renderRootSync (react-dom.development.js:22670)
    at performSyncWorkOnRoot (react-dom.development.js:22293)
    at scheduleUpdateOnFiber (react-dom.development.js:21881)
    at updateContainer (react-dom.development.js:25482)
    at react-dom.development.js:26021
    at unbatchedUpdates (react-dom.development.js:22431)
    at legacyRenderSubtreeIntoContainer (react-dom.development.js:26020)
    at Object.render (react-dom.development.js:26103)
    at Module.<anonymous> (index.js:6)
    at Module../src/index.js (index.js:8)
    at __webpack_require__ (bootstrap:851)
    at fn (bootstrap:150)
    at Object.1 (index.js:8)
    at __webpack_require__ (bootstrap:851)
    at checkDeferredModules (bootstrap:45)
    at Array.webpackJsonpCallback [as push] (bootstrap:32)
    at main.chunk.js:1

Please help I just want to clear everything and start over but npm cache is fucking trash and I cant even clean it, npm does not let me to do this.

VityaSchel commented 3 years ago

Im afraid if I delete npm cache folder I break all my projects and maybe I won't be able to use npm ever again even if I reinstall it because authors of npm are truly shit coders

VityaSchel commented 3 years ago

ok problem resolved when I installed it with yarn