Closed darrylyeo closed 9 months ago
Describe the bug
The IFlatMetadata definition arbitrarily excludes boolean values, which causes usages of flattenTree to fail type checks in some cases.
IFlatMetadata
boolean
flattenTree
Code That Causes The Issue
https://github.com/dgreene1/react-accessible-treeview/blob/b3d2ee78e1d2f3bceff29e7b2b6426107b6a3ed8/src/TreeView/utils.ts#L290-L293
To Reproduce
flattenTree([{ name: 'node', metadata: { isModified: true } }])
Expected behavior
export type IFlatMetadata = Record<string, string | number | boolean | undefined | null>;
Or just... copy the metadata object references as is? Not sure why nested objects couldn't be allowed here.
We’re open to a PR if you’d like to try to fix the lack of boolean support.
Describe the bug
The
IFlatMetadata
definition arbitrarily excludesboolean
values, which causes usages offlattenTree
to fail type checks in some cases.Code That Causes The Issue
https://github.com/dgreene1/react-accessible-treeview/blob/b3d2ee78e1d2f3bceff29e7b2b6426107b6a3ed8/src/TreeView/utils.ts#L290-L293
To Reproduce
Expected behavior
Or just... copy the metadata object references as is? Not sure why nested objects couldn't be allowed here.