Skip to content

Commit 5218484

Browse files
chad1008ciampo
andauthored
Components: refactor Snackbar to pass exhaustive-deps (#44934)
* add explicitDismiss to dep array * Components: update CHANGELOG Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
1 parent 77c48c3 commit 5218484

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/components/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
### Internal
1515

16+
- `Snackbar`: updated to satisfy `react/exhaustive-deps` eslint rule ([#44934](https://github.com/WordPress/gutenberg/pull/44934))
1617
- `AnglePickerControl`: Set Storybook Label control type to 'text' ([#45122](https://github.com/WordPress/gutenberg/pull/45122)).
1718
- `Button`: Refactor Storybook to controls and align docs ([#44105](https://github.com/WordPress/gutenberg/pull/44105)).
1819

packages/components/src/snackbar/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function Snackbar(
9393
}, NOTICE_TIMEOUT );
9494

9595
return () => clearTimeout( timeoutHandle );
96-
}, [ onDismiss, onRemove ] );
96+
}, [ onDismiss, onRemove, explicitDismiss ] );
9797

9898
const classes = classnames( className, 'components-snackbar', {
9999
'components-snackbar-explicit-dismiss': !! explicitDismiss,

0 commit comments

Comments
 (0)