Skip to content

Commit

Permalink
add useMemo for id generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanalvizo committed May 16, 2023
1 parent d4c2ad9 commit a713c80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/iris-grid/src/GotoRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import React, {
KeyboardEvent,
ReactElement,
useEffect,
useMemo,
useRef,
useState,
} from 'react';
Expand Down Expand Up @@ -89,7 +90,7 @@ function GotoRow({

const { rowCount } = model;

const gotoRowInputId = `goto-row-input-${shortid()}`;
const gotoRowInputId = useMemo(() => `goto-row-input-${shortid()}`, []);

const handleGotoValueNumberKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
if (e.key === 'Enter') {
Expand Down

0 comments on commit a713c80

Please sign in to comment.