diff --git a/src/blocks/blocks/circle-counter/inspector.js b/src/blocks/blocks/circle-counter/inspector.js index e0034abf1..3cdccbd11 100644 --- a/src/blocks/blocks/circle-counter/inspector.js +++ b/src/blocks/blocks/circle-counter/inspector.js @@ -29,6 +29,7 @@ import { Fragment, useState } from '@wordpress/element'; * Internal dependencies */ import { InspectorHeader } from '../../components'; +import { useTabSwitch } from '../../helpers/block-utility'; /** * @@ -40,7 +41,7 @@ const Inspector = ({ setAttributes }) => { - const [ tab, setTab ] = useState( 'settings' ); // TODO: After #1801 is merged, use `useTabState` hook. + const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' ); const onPercentageChange = value => { if ( value === undefined ) { diff --git a/src/blocks/blocks/progress-bar/inspector.js b/src/blocks/blocks/progress-bar/inspector.js index ef20ec212..4f97894f7 100644 --- a/src/blocks/blocks/progress-bar/inspector.js +++ b/src/blocks/blocks/progress-bar/inspector.js @@ -28,6 +28,7 @@ import { Fragment, useState } from '@wordpress/element'; * Internal dependencies */ import { InspectorHeader } from '../../components'; +import { useTabSwitch } from '../../helpers/block-utility'; const defaultFontSizes = [ @@ -66,7 +67,7 @@ const Inspector = ({ setHeightMode }) => { - const [ tab, setTab ] = useState( 'settings' ); // TODO: After #1801 is merged, use `useTabState` hook. + const [ tab, setTab ] = useTabSwitch( attributes.id, 'settings' ); const onPercentageChange = value => { if ( value === undefined ) {