ghiscoding / slickgrid-react

Slickgrid-React is a wrapper of the lightning fast & customizable SlickGrid datagrid, it also includes multiple Styling Themes
https://ghiscoding.github.io/slickgrid-react/
Other
33 stars 12 forks source link

Issue in Mounting #301

Closed seeranjeeviramavel closed 8 months ago

seeranjeeviramavel commented 8 months ago

Describe the bug

Issue Description: I'm encountering a runtime error while using the slickgrid-react library. The error message indicates "Cannot read properties of null (reading 'id')", and the stack trace points to a specific location within the slickgrid-react codebase.

Expected Behavior: The component should render without any runtime errors, and the slickgrid-react library should function as expected.

Additional Context: Version of slickgrid-react being used. Relevant code snippets or configurations that might be related to the issue. Any other relevant information about the environment or setup where the issue is occurring.

Error Message: Cannot read properties of null (reading 'id')

Here is the copy of the codesanbox i've worked: https://codesandbox.io/p/sandbox/slick-grid-test3-xfs9f8?file=%2Fsrc%2FGridTest%2FGrid.tsx%3A901%2C34-901%2C39

Expectation

Environment Info

I'm using codesandbox

Validations

Pratosh22 commented 8 months ago

I had faced the same problem too, You can disable/remove React.strictMode and it should work fine.

ghiscoding commented 8 months ago

I'm not a React developer myself, if you know how to resolve this kind of problem then please contribute or else I close this issue since an alternative was provided. The slickgrid-react-demo GitHub repo is updated for every release and it works as intended.

Side note, I already provided a Git repo for a demo above, I don't have time to convert it to a codesandbox (BTW, your codesandbox link is not working). This is a free Open Source project that I maintain in my spare time, I would appreciate contributions. Thanks

seeranjeeviramavel commented 8 months ago

I had faced the same problem too, You can disable/remove React.strictMode and it should work fine.

Thanks. It works <3

ghiscoding commented 8 months ago

I took a quick look at that React StrictMode and from what I can see, it's way too strict and doesn't make any sense in some cases since it goes way further than what TypeScript already does. It even fails in SortableJS which is an external library that I have no control of. I added couple of extra checks but that doesn't seem to be enough to cover everything because like I said, it's way too strict and I don't think it will be possible to ever support that strict mode... so with that in mind, I'm closing this issue, just go disable strict mode like suggested. Thanks