icflorescu / icflorescu/mantine-datatable

Vague error when forgetting storeColumnsKey in datatable for column toggling.

Open
#706 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Call the useDataTableColumns hook with some key (e.g. "UserColumnKey")
  2. Don't include the storeColumnsKey prop in your data table.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.