Is there a better explanation on how to implement sorting in React-Data-Grid?
The example on the website is utterly confusing.
https://adazzle.github.io/react-data-grid/docs/examples/column-sorting
Nothing is explained, and the example deals with initialRows and the react utility funciton useState.
Why do I need to use setRows in the following example?
onGridSort={(sortColumn, sortDirection) =>
setRows(sortRows(initialRows, sortColumn, sortDirection))
}
Where does this setRows object come from? Why is useState being used in this presentational component? What is it? Where does it come from?