useEnumToArray
#
DescriptionHook to convert an enum to an array.
#
Usageimport { useEnumToArray } from '@springtree/eva-suite-react-hooks';
enum ExampleEnum { ExampleEnumValue1 = 1, ExampleEnumValue2 = 2, ExampleEnumValue3 = 3, ExampleEnumValue4 = 4, ExampleEnumValue5 = 5, ExampleEnumValue6 = 6, ExampleEnumValue7 = 7, ExampleEnumValue8 = 8,}
const Example = () => { // Type: ({ key: string, value: number })[] const enumAsArray = useEnumToArray(ExampleEnum);
// ...};
export default Example;