gregnb / gregnb/mui-datatables
customHeadRender not working
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 906
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I am trying to use `customHeadRender` in order to use my own icon. I keep getting this bug despite following the documentation on how write the `customHeadRender`.
Here is how my `customHeadRender` is written as:
` customHeadRender: (columnMeta, handleToggleColumn, sortOrder) => {
return (
Last Modified
)
}`
Whenever I click on the `TableSortLabel`, I expect the `handleToggleColumn` function to run and sort the list. But instead, I get this bug:

`TypeError: a[d] is undefined`
Is there a way to fix this. Are there any examples on how to do `customHeadRender`?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the reported customHeadRender case using the shown TableCell, TableSortLabel, and handleToggleColumn entry points. Confirm that clicking the label sorts the list without the reported TypeError; document or test the working customHeadRender usage once the behavior is corrected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100