icflorescu / icflorescu/mantine-datatable
Vague error when forgetting storeColumnsKey in datatable for column toggling.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Forgetting to include the storeColumnsKey prop in a data table causes a very vague runtime error Uncaught TypeError: can't access property "filter", N is undefined
To Reproduce
- Call the
useDataTableColumnshook with some key (e.g."UserColumnKey") - Don't include the
storeColumnsKeyprop in your data table. - Render the table.
Expected behavior
I'm no expert, but better error handling would have saved me 3 hours of debugging. Even just something hinting that the issue is from column toggling e.g. "Columns support toggling but data table cannot render toggled columns without key."
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the useDataTableColumns hook and a data table missing the storeColumnsKey prop. Trace the source of the undefined filter error and add an actionable error for this configuration; done means the table no longer reports the vague runtime error and identifies the missing key or required setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100