From 28e0492942fae6cdfa8175af750883b057294b7f Mon Sep 17 00:00:00 2001 From: Ivaylo Pavlov Date: Wed, 16 Oct 2024 00:51:40 +0100 Subject: [PATCH] useMemo --- .../src/plugins/TableHoverActionsPlugin/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/lexical-playground/src/plugins/TableHoverActionsPlugin/index.tsx b/packages/lexical-playground/src/plugins/TableHoverActionsPlugin/index.tsx index 3783a92c7d9..4c88e8d52b3 100644 --- a/packages/lexical-playground/src/plugins/TableHoverActionsPlugin/index.tsx +++ b/packages/lexical-playground/src/plugins/TableHoverActionsPlugin/index.tsx @@ -20,7 +20,7 @@ import { } from '@lexical/table'; import {$findMatchingParent, mergeRegister} from '@lexical/utils'; import {$getNearestNodeFromDOMNode, NodeKey} from 'lexical'; -import {useEffect, useRef, useState} from 'react'; +import {useEffect, useMemo, useRef, useState} from 'react'; import * as React from 'react'; import {createPortal} from 'react-dom'; @@ -134,7 +134,7 @@ function TableHoverActionsContainer({ // Hide the buttons on any table dimensions change to prevent last row cells // overlap behind the 'Add Row' button when text entry changes cell height - const tableResizeObserver = React.useMemo(() => { + const tableResizeObserver = useMemo(() => { return new ResizeObserver(() => { setShownRow(false); setShownColumn(false);