Commit ab431292317 for woocommerce
commit ab431292317a23ae43c09dfc86a7f63a0dada756
Author: Jorge A. Torres <jorge.torres@automattic.com>
Date: Fri Mar 6 22:18:19 2026 +0000
Fix unstable `useSelect()` return value in `useCustomerEffortScoreModal` (#63554)
diff --git a/packages/js/customer-effort-score/changelog/fix-62340-ces b/packages/js/customer-effort-score/changelog/fix-62340-ces
new file mode 100644
index 00000000000..5b656c946b4
--- /dev/null
+++ b/packages/js/customer-effort-score/changelog/fix-62340-ces
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Fix unstable `useSelect()` return value in feedback button.
diff --git a/packages/js/customer-effort-score/src/hooks/use-customer-effort-score-modal/index.ts b/packages/js/customer-effort-score/src/hooks/use-customer-effort-score-modal/index.ts
index 676595d371b..10d82c9cc24 100644
--- a/packages/js/customer-effort-score/src/hooks/use-customer-effort-score-modal/index.ts
+++ b/packages/js/customer-effort-score/src/hooks/use-customer-effort-score-modal/index.ts
@@ -10,36 +10,44 @@ import { optionsStore } from '@woocommerce/data';
import { SHOWN_FOR_ACTIONS_OPTION_NAME } from '../../constants';
import { STORE_KEY } from '../../store';
+const EMPTY_SHOWN_ACTIONS: string[] = [];
+
export const useCustomerEffortScoreModal = () => {
const { showCesModal: _showCesModal, showProductMVPFeedbackModal } =
useDispatch( STORE_KEY );
const { updateOptions } = useDispatch( optionsStore );
- const { wasPreviouslyShown, isLoading } = useSelect( ( select ) => {
+ const { shownForActions, isLoading } = useSelect( ( select ) => {
const { getOption, hasFinishedResolution } = select( optionsStore );
- const shownForActionsOption =
- ( getOption( SHOWN_FOR_ACTIONS_OPTION_NAME ) as string[] ) || [];
+ const rawShownForActions = getOption( SHOWN_FOR_ACTIONS_OPTION_NAME );
+ const shownForActionsOption = Array.isArray( rawShownForActions )
+ ? rawShownForActions
+ : EMPTY_SHOWN_ACTIONS;
const resolving = ! hasFinishedResolution( 'getOption', [
SHOWN_FOR_ACTIONS_OPTION_NAME,
] );
return {
- wasPreviouslyShown: ( action: string ) => {
- return shownForActionsOption.includes( action );
- },
+ shownForActions: shownForActionsOption,
isLoading: resolving,
};
}, [] );
+ const wasPreviouslyShown = ( action: string ) => {
+ return shownForActions.includes( action );
+ };
+
const markCesAsShown = async ( action: string ) => {
const { getOption } = resolveSelect( optionsStore );
- const shownForActionsOption =
- ( ( await getOption(
- SHOWN_FOR_ACTIONS_OPTION_NAME
- ) ) as string[] ) || [];
+ const rawShownForActions = await getOption(
+ SHOWN_FOR_ACTIONS_OPTION_NAME
+ );
+ const shownForActionsOption = Array.isArray( rawShownForActions )
+ ? rawShownForActions
+ : [];
updateOptions( {
[ SHOWN_FOR_ACTIONS_OPTION_NAME ]: [
diff --git a/plugins/woocommerce/changelog/fix-62340-ces b/plugins/woocommerce/changelog/fix-62340-ces
new file mode 100644
index 00000000000..ad90041ace2
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-62340-ces
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Address deprecation warnings in feedback button.
diff --git a/plugins/woocommerce/client/blocks/assets/js/editor-components/ces-feedback-button/index.tsx b/plugins/woocommerce/client/blocks/assets/js/editor-components/ces-feedback-button/index.tsx
index 6d18695ba66..efa0205b85c 100644
--- a/plugins/woocommerce/client/blocks/assets/js/editor-components/ces-feedback-button/index.tsx
+++ b/plugins/woocommerce/client/blocks/assets/js/editor-components/ces-feedback-button/index.tsx
@@ -95,6 +95,7 @@ export const CesFeedbackButton = ( {
return (
<div>
<TextareaControl
+ __nextHasNoMarginBottom
label={ feedbackLabel }
value={
extraFieldsValues.feedback_comment || ''
@@ -108,6 +109,8 @@ export const CesFeedbackButton = ( {
placeholder={ feedbackPlaceholder }
/>
<TextControl
+ __next40pxDefaultSize
+ __nextHasNoMarginBottom
label={ emailLabel }
type="email"
value={ extraFieldsValues.email || '' }