Skip to content

Commit

Permalink
Tabs: Fix infinite loop in useEffect (WordPress#58861)
Browse files Browse the repository at this point in the history
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: andrewhayward <andrewhayward@git.wordpress.org>
Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
  • Loading branch information
4 people authored Feb 9, 2024
1 parent 9010d45 commit 194d208
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- `Placeholder`: Fix Global Styles typography settings bleeding into placeholder component ([#58303](https://github.com/WordPress/gutenberg/pull/58303)).
- `PaletteEdit`: Fix palette item accessibility in details view ([#58214](https://github.com/WordPress/gutenberg/pull/58214)).
- `Snackbar`: Fix the auto-dismissal timers ([#58604](https://github.com/WordPress/gutenberg/pull/58604)).
- `Tabs`: Fix infinite loop in `useEffect` ([#58861](https://github.com/WordPress/gutenberg/pull/58861)).

### Experimental

Expand Down
8 changes: 1 addition & 7 deletions packages/components/src/tabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,7 @@ function Tabs( {
if ( tabsHavePopulated.current && !! selectedTabId && ! selectedTab ) {
setSelectedId( null );
}
}, [
isControlled,
selectedId,
selectedTab,
selectedTabId,
setSelectedId,
] );
}, [ isControlled, selectedTab, selectedTabId, setSelectedId ] );

useEffect( () => {
if ( ! isControlled ) {
Expand Down

0 comments on commit 194d208

Please sign in to comment.