Description
- Have you already searched for similar issues? Please help us out and double-check first!
Yes, I have seen lot's of issues and PR related to this, however, it is still not clear for me what if the current status just to mention a few Headers custom component #410 Pass props to custom sortable header renderer #1148 Pass headerRenderer to SortableHeaderCell when column is sortable #572 looking at this it seems is possible to use a headerRenderer and Sortable: True but looking at the current state of the code here it seems is not?
Which version of React JS are you using?
✅ Officially supported ✅
- v15.4.x
☣️ Not officially supported, expect warnings and errors ☣️
- v16.x.x
Which browser are you using?
✅ Officially supported ✅
- Chrome
I'm submitting a ...
- 🐛 Bug Report
- 💡 Feature Request
Issue Details
-
Current behavior
If I pass a custom headerRenderer and Sortable as true I get the following error:Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
If I pass the headerRenderer and Sortable as false I get no error and it works correctly.
-
Desired behavior
- If I pass headerRendered and Sortable true it should work?
- Update docs to indicate how to use a headerRenderer
- Update docs to indicate if possible to use a headerRender with sortable true
- Update docs to include an example of using a Custom headerRenderer
- Provide a way to pass specific styles or CSS class to each column header?
I'm willing to help if needed with a PR for docs or even code, but I would like to know first the current status of this as is not clear on the current docs. I have provided an example repo that test with the latest react version and the officially supported v15.4.x
I created an example repo that demonstrates the issue here: Example repo and I can see more details about the error there:
If you change sortable to false it should correctly
I also created a branch that uses the officially supported react version(15.4.x) and the error there is on the console:
Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in
And btw thanks for this awesome grid it has really helped us deliver great value to our clients.