Skip to content

Commit

Permalink
Add comment for usage of useRef
Browse files Browse the repository at this point in the history
  • Loading branch information
vcanales committed Oct 15, 2021
1 parent db3d43d commit 8ee78b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/block-library/src/search/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 8ee78b6

Please sign in to comment.