inovua / reactdatagrid

Empower Your Data with the best React Data Grid there is
https://reactdatagrid.io
Other
3.45k stars 57 forks source link

Component throws error in strict mode on nextjs. #379

Open missingsemi opened 10 months ago

missingsemi commented 10 months ago

Using community edition version 5.10.2 with react 19.2.0 and next 13.4.19

What you did: Tried using the table component in nextjs (it have a useEffect set up so it only client side renders).

What happened: I got this error when the page loaded

Unhandled Runtime Error

TypeError: _this.cells is null
Call Stack
InovuaDataGridHeader/<
node_modules\@inovua\reactdatagrid-community\Layout\ColumnLayout\HeaderLayout\Header\index.js (196:0)
InovuaDataGridCell/<
node_modules\@inovua\reactdatagrid-community\Layout\ColumnLayout\Cell\index.js (139:0)
commitHookEffectListMount
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (19980:0)
invokePassiveEffectMountInDEV
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (22862:0)
invokeEffectsInDev
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (25600:0)
legacyCommitDoubleInvokeEffectsInDEV
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (25583:0)
commitDoubleInvokeEffectsInDEV
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (25564:0)
flushPassiveEffectsImpl
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (25273:0)
flushPassiveEffects
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (25197:0)
performSyncWorkOnRoot
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (23671:0)
flushSyncWorkAcrossRoots_impl
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (9970:0)
flushSyncWorkOnAllRoots
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (9928:0)
commitRootImpl
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (25128:0)
commitRoot
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (24846:0)
commitRootWhenReady
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (23584:0)
finishConcurrentRender
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (23549:0)
performConcurrentWorkOnRoot
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (23394:0)
workLoop
node_modules\next\dist\compiled\scheduler\cjs\scheduler.development.js (261:0)
flushWork
node_modules\next\dist\compiled\scheduler\cjs\scheduler.development.js (230:0)
performWorkUntilDeadline
node_modules\next\dist\compiled\scheduler\cjs\scheduler.development.js (534:0)

Reproduction repository: https://github.com/missingsemi/rdg-error

Couldn't reproduce with just create-react-app, so it seems to be something about nextjs along with reactdatagrid breaking. The error only occurs while running in strict mode.

ThinhNguyenHoang1 commented 9 months ago

Encountered the same problem as well. But mine works fine on 13.4.19 but breaks on 13.5.3