From e707a3073eeda9bde0a05f1ab221908ecc2bd56c Mon Sep 17 00:00:00 2001 From: Daniel Richards Date: Mon, 9 Nov 2020 11:49:58 +0800 Subject: [PATCH] Call getBlockInsertionPoint once --- .../src/components/inserter/hooks/use-insertion-point.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/block-editor/src/components/inserter/hooks/use-insertion-point.js b/packages/block-editor/src/components/inserter/hooks/use-insertion-point.js index a6a2c1042cea23..db67c49f80354f 100644 --- a/packages/block-editor/src/components/inserter/hooks/use-insertion-point.js +++ b/packages/block-editor/src/components/inserter/hooks/use-insertion-point.js @@ -75,10 +75,9 @@ function useInsertionPoint( { } else { // Otherwise, we're in "auto mode" where the insertion point is // decided by getBlockInsertionPoint(). - - _destinationRootClientId = getBlockInsertionPoint() - .rootClientId; - _destinationIndex = getBlockInsertionPoint().index; + const insertionPoint = getBlockInsertionPoint(); + _destinationRootClientId = insertionPoint.rootClientId; + _destinationIndex = insertionPoint.index; } return {