useSortBy
Last updated
Was this helpful?
Last updated
Was this helpful?
The useSortBy hook exposes methods and data for sorting results, internally it is used by the .
The sortOptions
field is an array of all available sort options.
The sortOption
field is the currently selected sort option, by default this is the first sort option.
The setSortOption
method can be used to change the sort option, you must provide the handle
value of one of the sort options.