TypeError: Cannot read properties of null (reading 'useState')
Closed this issue · 5 comments
Describe the bug
TypeError: Cannot read properties of null (reading 'useState')
To Reproduce
Steps to reproduce the behavior:
- Add package - yarn add mui-chips-input
- Import Package
- Compile Code
Expected behavior
Expecting @mui chips input...
GOT
`Unhandled Runtime Error
TypeError: Cannot read properties of null (reading 'useState')
Call Stack
Object.useState
node_modules/mui-chips-input/node_modules/react/cjs/react.development.js (1622:0)
eval
node_modules/mui-chips-input/dist/mui-chips-input.es.js (131:18)
renderWithHooks
node_modules/react-dom/cjs/react-dom.development.js (16175:0)
updateForwardRef
node_modules/react-dom/cjs/react-dom.development.js (20023:0)
beginWork
node_modules/react-dom/cjs/react-dom.development.js (22465:0)
HTMLUnknownElement.callCallback
node_modules/react-dom/cjs/react-dom.development.js (4161:0)
Object.invokeGuardedCallbackDev
node_modules/react-dom/cjs/react-dom.development.js (4210:0)
invokeGuardedCallback
node_modules/react-dom/cjs/react-dom.development.js (4274:0)
beginWork$1
node_modules/react-dom/cjs/react-dom.development.js (27405:0)
performUnitOfWork
node_modules/react-dom/cjs/react-dom.development.js (26513:0)
workLoopSync
node_modules/react-dom/cjs/react-dom.development.js (26422:0)
renderRootSync
node_modules/react-dom/cjs/react-dom.development.js (26390:0)
performSyncWorkOnRoot
node_modules/react-dom/cjs/react-dom.development.js (26041:0)
flushSyncCallbacks
node_modules/react-dom/cjs/react-dom.development.js (12009:0)
flushSync
node_modules/react-dom/cjs/react-dom.development.js (26157:0)
finishEventHandler
node_modules/react-dom/cjs/react-dom.development.js (3973:0)
batchedUpdates
node_modules/react-dom/cjs/react-dom.development.js (3991:0)
dispatchEventForPluginEventSystem
node_modules/react-dom/cjs/react-dom.development.js (9284:0)
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay
node_modules/react-dom/cjs/react-dom.development.js (6462:0)
dispatchEvent
node_modules/react-dom/cjs/react-dom.development.js (6454:0)
dispatchDiscreteEvent
node_modules/react-dom/cjs/react-dom.development.js (6427:0)`
I just clone the GitHub repository, with some fixes it works fine...
Hey !
Please give a repro link, what did you update, etc... help me
Hey viclafouch!
All I did is adding the yarn package to my project, every thing looks just fine, but when I add the component to my project I just get that type error, You guys wrote C.useState("")
when C is imported from React... Yet when it compiles we get Cannot read properties of null (reading 'useState')
. I tried to modify the package in the node_modules but that did not work, so I just cloned the repository and I updated the imports of internal components and made it part of my project depending on my package.json, and it works fine... So I think the problem is not with the source code... it is with the NPM package...
Any thing to help...
I'm having the same issue, any fix?
I just installed the last version add:
and is not working.
I'm using NextJs
Hey viclafouch!
All I did is adding the yarn package to my project, every thing looks just fine, but when I add the component to my project I just get that type error, You guys wrote
C.useState("")
when C is imported from React... Yet when it compiles we getCannot read properties of null (reading 'useState')
. I tried to modify the package in the node_modules but that did not work, so I just cloned the repository and I updated the imports of internal components and made it part of my project depending on my package.json, and it works fine... So I think the problem is not with the source code... it is with the NPM package...Any thing to help...
I cloned source code and I called it internally and it works for now.