From 8ee78b6719b040b2ba07650339988bd3f9c87986 Mon Sep 17 00:00:00 2001 From: Vicente Canales Date: Fri, 15 Oct 2021 16:49:11 -0300 Subject: [PATCH] Add comment for usage of useRef --- packages/block-library/src/search/edit.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/block-library/src/search/edit.js b/packages/block-library/src/search/edit.js index eeb0d23c9ff8e9..b5a9b703f1b651 100644 --- a/packages/block-library/src/search/edit.js +++ b/packages/block-library/src/search/edit.js @@ -87,6 +87,8 @@ export default function SearchEdit( { return wasBlockJustInserted( clientId ); } ); + // Save a ref to this value, as it would become outdated + // if any other blocks are added. const isNewBlockRef = useRef( isNewBlock ); if (