Skip to content

Commit

Permalink
Nora review
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviendelangle committed Sep 25, 2024
1 parent a63f3ce commit 263e71b
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const extractPluginParamsFromProps = <
TSignatures extends readonly TreeViewPluginSignature<any>[],
TProps extends Partial<UseTreeViewBaseProps<TSignatures>>,
>({
props: { slots, slotProps, apiRef, experimentalFeatures, ...props },
props: { slots, slotProps, apiRef, experimentalFeatures: inExperimentalFeatures, ...props },
plugins,
}: ExtractPluginParamsFromPropsParameters<
TSignatures,
Expand All @@ -54,15 +54,15 @@ export const extractPluginParamsFromProps = <
}
});

const cleanExperimentalFeatures =
experimentalFeatures ?? ({} as NonNullable<typeof experimentalFeatures>);
const experimentalFeatures =
inExperimentalFeatures ?? ({} as NonNullable<typeof inExperimentalFeatures>);

const defaultizedPluginParams = plugins.reduce(
(acc, plugin: TreeViewPlugin<TreeViewAnyPluginSignature>) => {
if (plugin.getDefaultizedParams) {
return plugin.getDefaultizedParams({
params: acc,
experimentalFeatures: cleanExperimentalFeatures,
experimentalFeatures,
});
}

Expand All @@ -77,6 +77,6 @@ export const extractPluginParamsFromProps = <
pluginParams: defaultizedPluginParams,
slots: slots ?? ({} as any),
slotProps: slotProps ?? ({} as any),
experimentalFeatures: cleanExperimentalFeatures,
experimentalFeatures,
};
};

0 comments on commit 263e71b

Please sign in to comment.