Hooks
useSortObjByProperty

Import this in your client-side component

MyComponent.tsx
import { useSortObjByProperty } from "react-amazing-hooks";
APIDescriptionTypeReturn TypeExample
arrArray of objects to be sortedArray<object>voidNote*
propertyName of the property to sort bystringvoidNote*
orderSorting order, either asc/true for ascending or desc/false for descending`ascdesctrue
useSortObjByPropertyHook that sorts an array of objects based on a specified propertyfunctionArray<object>Note*
sortedArraySorted array of objectsArray<object>Array<object>Note*

Check the 'Example' tab above the table for an exhaustive example. *