Skip to content

Commit

Permalink
Components: refactor Snackbar to pass exhaustive-deps (#44934)
Browse files Browse the repository at this point in the history
* add explicitDismiss to dep array

* Components: update CHANGELOG

Co-authored-by: Marco Ciampini <marco.ciampo@gmail.com>
  • Loading branch information
chad1008 and ciampo authored Oct 21, 2022
1 parent 77c48c3 commit 5218484
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

### Internal

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

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/snackbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function Snackbar(
}, NOTICE_TIMEOUT );

return () => clearTimeout( timeoutHandle );
}, [ onDismiss, onRemove ] );
}, [ onDismiss, onRemove, explicitDismiss ] );

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

0 comments on commit 5218484

Please sign in to comment.