Issue involves React StrictMode-specific behavior and undo functionality in the Site Editor.
The issue describes unexpected undo behavior in the Site Editor when React StrictMode is enabled, leading to extra history records and cleared template part content. Testing instructions are provided, but the issue may involve deeper React lifecycle or state management concerns. A potential fix (#73378) is mentioned but requires verification.
I noticed unexpected behavior when undoing changes in the Site Editor and React StrictMode is enabled.
After undoing the recently made changes, there are extra history records, and the template part content is gone after the changes are entirely undone. The issue affects unmodified template parts with the Navigation block.
[!NOTE]
The bug doesn't affect WP 6.6 or production websites running the Gutenberg plugin.
SCRIPT_DEBUG so React code runs in a StrictMode.https://github.com/WordPress/gutenberg/assets/240569/3684a74c-9f79-4af8-b9eb-f770dede21dc
https://github.com/WordPress/gutenberg/assets/240569/fa50dc77-b086-4984-ab9f-360cc2d49acb
Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!