SortField vs Column Interface: Having an explicit sortField on column was confusing to me.
Feature Check list
- [X] Agree to the Code of Conduct
- [X] Read the README to ensure the feature is not already present
- [X] You read Creating Issues, Features and Pull Requests
- [X] Considered the value versus complexity for all users of the library as well as library maintenance
- [X] Considered if this can be a storybook or documentation example
Hi JBetancur and all. Long time listener...
I notice looking at the code and docs that there's no requirement in the code that sortField be a string and beyond that it isn't "strictly necessary" in RDTC since the column type is typed as an interface. I was confused by sortField being there since it is so close to sortFieldId but does not participate in that system.
Could the column be typed in a way that retains full knowledge of that type when returned to onSort, TableColumn.cell etc? maybe export type TableProps<T, Column extends TableColumn<T>= TableColumn<T>>?
This would resolve sortField, but also make things like Column based rendering more available in the system. (Its already possible, but not mentioned anywhere, as far as I can tell)
Would be happy to make a PR if thats interesting.
Thanks for your hard work Alex Mouton