From 61c8c549d05216868f70e125d5a1e5763e236e51 Mon Sep 17 00:00:00 2001 From: ArturAbdullin Date: Thu, 25 Apr 2024 19:03:26 +0300 Subject: [PATCH] refactor(Table.stories): remove redundant useCallback --- .../Table/__stories__/Table.stories.tsx | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/components/Table/__stories__/Table.stories.tsx b/src/components/Table/__stories__/Table.stories.tsx index 3c9f55d86e..13062ec13f 100644 --- a/src/components/Table/__stories__/Table.stories.tsx +++ b/src/components/Table/__stories__/Table.stories.tsx @@ -205,21 +205,12 @@ const DEFAULT_SETTINGS = columns.map((x) => ({id: x.id, isSelected: true})); const WithTableSettingsTemplate: StoryFn> = (args, context) => { const [settings, setSettings] = React.useState(DEFAULT_SETTINGS); - const updateSettings = React.useCallback( - async (updatedSettings: TableSettingsData) => setSettings(updatedSettings), - [], - ); - if (context.parameters.isFactory) { return ( - + ); } else { - return ; + return ; } }; export const HOCWithTableSettings = WithTableSettingsTemplate.bind({}); @@ -254,16 +245,11 @@ HOCWithTableSettingsFactory.parameters = { const WithTableSettingsWithResetTemplate: StoryFn> = (args) => { const [settings, setSettings] = React.useState(DEFAULT_SETTINGS); - const updateSettings = React.useCallback( - async (updatedSettings: TableSettingsData) => setSettings(updatedSettings), - [], - ); - return (