I am using the Filemanager component in a Typescript project and I think I found a bug in the way the typescript declairation file defines the menuOptions for the Filemanager component. It appears to curry the function when the documentation does not show to do so. When I try it out on my project I get a type error. When I remove the currying, I have to cast the function to any to get it to compile, but it does function as I expect.
from index.d.ts:
menuOptions?: () => (
mode: TContextMenuType,
item?: IParsedEntity,
) => IFileMenuOption[];
from the documentation:
function menuOptions(mode, item) {
switch (mode) {
case "file":
case "folder":
if (item.id === "/Code") return false;
default:
return getMenuOptions(mode);
}
}
return <Filemanager data={getData()} drive={getDrive()} menuOptions={menuOptions} />;
In order to get my code to compile I would need to replace menuOptions with menuOptions={() => menuOptions}