Skip to content

Commit

Permalink
Components: refactor NavigatorButton to pass exhaustive-deps (#42051
Browse files Browse the repository at this point in the history
)

* `NavigatorButton`: add `attributeName` & `escapedPath` to `useCallback` dep array

* add entry to components `CHANGELOG.md`
  • Loading branch information
flootr authored Sep 5, 2022
1 parent bd7c82b commit f821819
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 @@ -29,6 +29,7 @@
- `NavigableContainer`: use `code` instead of `keyCode` for keyboard events, rewrite tests using RTL and `user-event` ([#43606](https://github.com/WordPress/gutenberg/pull/43606/)).
- `ComboboxControl`: updated to satisfy `react/exhuastive-deps` eslint rule ([#41417](https://github.com/WordPress/gutenberg/pull/41417))
- `FormTokenField`: Refactor away from Lodash ([#43744](https://github.com/WordPress/gutenberg/pull/43744/)).
- `NavigatorButton`: updated to satisfy `react/exhaustive-deps` eslint rule ([#42051](https://github.com/WordPress/gutenberg/pull/42051))

## 20.0.0 (2022-08-24)

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/navigator/navigator-button/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function useNavigatorButton(
} );
onClick?.( e );
},
[ goTo, onClick ]
[ goTo, onClick, attributeName, escapedPath ]
);

return {
Expand Down

0 comments on commit f821819

Please sign in to comment.