From 202a155d036d32259ddc8efe0be6a700c7d54483 Mon Sep 17 00:00:00 2001 From: Alan Date: Mon, 7 Oct 2024 11:26:42 +1100 Subject: [PATCH] Issue #3476889 - Fixed useEffect only running on load due to blank deps. (#1309) Co-authored-by: Alex Skrypnyk (AlexSkrypnyk) Joshua Fernandes <83997348+joshua-salsadigital@users.noreply.github.com> --- web/themes/contrib/civictheme/.storybook/preview.js | 2 +- .../civictheme/civictheme_starter_kit/.storybook/preview.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/themes/contrib/civictheme/.storybook/preview.js b/web/themes/contrib/civictheme/.storybook/preview.js index 963867a5f..8c3f4a1ea 100644 --- a/web/themes/contrib/civictheme/.storybook/preview.js +++ b/web/themes/contrib/civictheme/.storybook/preview.js @@ -12,7 +12,7 @@ import { decoratorDocs } from '../components/00-base/storybook/storybook.docs.ut // Call attaching of behaviours. addDecorator((storyFn) => { - useEffect(() => Drupal.attachBehaviors(), []); + useEffect(() => Drupal.attachBehaviors()); return storyFn(); }); diff --git a/web/themes/contrib/civictheme/civictheme_starter_kit/.storybook/preview.js b/web/themes/contrib/civictheme/civictheme_starter_kit/.storybook/preview.js index f375d75e8..7537da721 100644 --- a/web/themes/contrib/civictheme/civictheme_starter_kit/.storybook/preview.js +++ b/web/themes/contrib/civictheme/civictheme_starter_kit/.storybook/preview.js @@ -12,7 +12,7 @@ import { decoratorDocs } from '../components_combined/00-base/storybook/storyboo // Call attaching of behaviours. addDecorator((storyFn) => { - useEffect(() => Drupal.attachBehaviors(), []); + useEffect(() => Drupal.attachBehaviors()); return storyFn(); });