From eb87c9e585c36cc930f3156e0e3e7fb6b74c9926 Mon Sep 17 00:00:00 2001 From: Wayne Wang Date: Thu, 5 Dec 2024 23:31:37 +0800 Subject: [PATCH] Revert previous change on state --- packages/components/src/foldable-card/index.jsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/components/src/foldable-card/index.jsx b/packages/components/src/foldable-card/index.jsx index cfa73d198f6a6..4b5339b2e3ccd 100644 --- a/packages/components/src/foldable-card/index.jsx +++ b/packages/components/src/foldable-card/index.jsx @@ -56,10 +56,7 @@ class FoldableCard extends Component { // @TODO: Please update https://github.com/Automattic/wp-calypso/issues/58453 if you are refactoring away from UNSAFE_* lifecycle methods! UNSAFE_componentWillReceiveProps( nextProps ) { - if ( - nextProps.expanded !== this.props.expanded || - nextProps.expanded !== this.state.expanded - ) { + if ( nextProps.expanded !== this.props.expanded ) { this.setState( { expanded: nextProps.expanded } ); } }