react-tagcloud icon indicating copy to clipboard operation
react-tagcloud copied to clipboard

Class components compatibility

Open Ashilex opened this issue 1 year ago • 1 comments

Is usage supported in react class components? I am using [email protected]

error reported in console

react.development.js:1622  Uncaught TypeError: Cannot read properties of null (reading 'useState')
    at useState (react.development.js:1622:1)
    at TagCloud (TagCloud.js:161:1)
    at renderWithHooks (react-dom.development.js:14803:1)
    at mountIndeterminateComponent (react-dom.development.js:17482:1)
    at beginWork (react-dom.development.js:18596:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js:188:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:237:1)
    at invokeGuardedCallback (react-dom.development.js:292:1)

thanks

Ashilex avatar Jan 17 '24 14:01 Ashilex

Hi, hooks has been introduced in react 16.8.0, so I suppose it should work. Anyway you could try to use version before hooks, although it might miss some features:

# react < 16.8.0
npm install [email protected]

madox2 avatar Jan 17 '24 15:01 madox2

Closing due to inactivity

madox2 avatar Apr 17 '24 11:04 madox2