From 6c5c5c10aafaa3b9436d143c42411ce250f73915 Mon Sep 17 00:00:00 2001 From: chad1008 <13856531+chad1008@users.noreply.github.com> Date: Thu, 19 May 2022 14:56:20 -0400 Subject: [PATCH 1/5] destructure `compsite.setCurrentId` outside of effect to avoid a loop. Update dependency array --- packages/components/src/alignment-matrix-control/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/components/src/alignment-matrix-control/index.js b/packages/components/src/alignment-matrix-control/index.js index d9665eb5d446dc..eac1fd2e77ab3a 100644 --- a/packages/components/src/alignment-matrix-control/index.js +++ b/packages/components/src/alignment-matrix-control/index.js @@ -53,11 +53,13 @@ export default function AlignmentMatrixControl( { onChange( nextValue ); }; + const { setCurrentId } = composite; + useEffect( () => { if ( typeof value !== 'undefined' ) { - composite.setCurrentId( getItemId( baseId, value ) ); + setCurrentId( getItemId( baseId, value ) ); } - }, [ value, composite.setCurrentId ] ); + }, [ value, setCurrentId, baseId ] ); const classes = classnames( 'component-alignment-matrix-control', From e872e6bf58637019b564263f6bd9f03d07118335 Mon Sep 17 00:00:00 2001 From: chad1008 <13856531+chad1008@users.noreply.github.com> Date: Mon, 23 May 2022 10:10:18 -0400 Subject: [PATCH 2/5] Components: update changelog --- packages/components/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index e64c24c6b7bbc6..268e875472867b 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -1,6 +1,7 @@ ## Unreleased +- `AlignmentMatrixControl` updated to satisfy `react/exhuastive-deps` eslint rule ([#41167](https://github.com/WordPress/gutenberg/pull/41167)) ### Internal From cdc78a4c6c9ed47b950f70a91d035e359ccd7072 Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Mon, 23 May 2022 19:00:17 +0200 Subject: [PATCH 3/5] Update packages/components/CHANGELOG.md --- packages/components/CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 268e875472867b..0bd8978212707a 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -1,7 +1,10 @@ ## Unreleased -- `AlignmentMatrixControl` updated to satisfy `react/exhuastive-deps` eslint rule ([#41167](https://github.com/WordPress/gutenberg/pull/41167)) + +### Internal + +- `AlignmentMatrixControl` updated to satisfy `react/exhuastive-deps` eslint rule ([#41167](https://github.com/WordPress/gutenberg/pull/41167)) ### Internal From ffa20791ac13c3590085cf18cff770c4161c9abd Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Mon, 23 May 2022 19:01:15 +0200 Subject: [PATCH 4/5] Update packages/components/CHANGELOG.md --- packages/components/CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 0bd8978212707a..6f5542187bf75a 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -4,10 +4,8 @@ ### Internal -- `AlignmentMatrixControl` updated to satisfy `react/exhuastive-deps` eslint rule ([#41167](https://github.com/WordPress/gutenberg/pull/41167)) - -### Internal +- `AlignmentMatrixControl` updated to satisfy `react/exhuastive-deps` eslint rule ([#41167](https://github.com/WordPress/gutenberg/pull/41167)) - `CheckboxControl`: Add unit tests ([#41165](https://github.com/WordPress/gutenberg/pull/41165)). ## 19.11.0 (2022-05-18) From dd613deb60b1da1efe0c75e5e0257b3dae2549db Mon Sep 17 00:00:00 2001 From: Marco Ciampini Date: Mon, 23 May 2022 19:01:37 +0200 Subject: [PATCH 5/5] Update packages/components/CHANGELOG.md --- packages/components/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index 6f5542187bf75a..52277deca063e5 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -4,7 +4,6 @@ ### Internal - - `AlignmentMatrixControl` updated to satisfy `react/exhuastive-deps` eslint rule ([#41167](https://github.com/WordPress/gutenberg/pull/41167)) - `CheckboxControl`: Add unit tests ([#41165](https://github.com/WordPress/gutenberg/pull/41165)).