Skip to content

Commit b59c48e

Browse files
use fastdeepequal
1 parent 0c1456a commit b59c48e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • packages/block-library/src/post-template

packages/block-library/src/post-template/edit.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* External dependencies
33
*/
44
import clsx from 'clsx';
5+
import fastDeepEqual from 'fast-deep-equal/es6/index.js';
56

67
/**
78
* WordPress dependencies
@@ -296,9 +297,10 @@ export default function PostTemplateEdit( {
296297
return;
297298
}
298299

299-
const hasLayoutChanged =
300-
JSON.stringify( previousLayoutRef.current ) !==
301-
JSON.stringify( layout );
300+
const hasLayoutChanged = ! fastDeepEqual(
301+
previousLayoutRef.current,
302+
layout
303+
);
302304

303305
if (
304306
hasLayoutChanged &&

0 commit comments

Comments
 (0)