File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change @@ -873,7 +873,10 @@ export function SelectCell<TData>({
873873 const [ value , setValue ] = React . useState ( initialValue ) ;
874874 const containerRef = React . useRef < HTMLDivElement > ( null ) ;
875875 const cellOpts = cell . column . columnDef . meta ?. cell ;
876- const options = cellOpts ?. variant === "select" ? cellOpts . options : [ ] ;
876+ const options = React . useMemo (
877+ ( ) => ( cellOpts ?. variant === "select" ? cellOpts . options : [ ] ) ,
878+ [ cellOpts ] ,
879+ ) ;
877880 const optionByValue = React . useMemo (
878881 ( ) => new Map ( options . map ( ( option ) => [ option . value , option ] ) ) ,
879882 [ options ] ,
@@ -1017,7 +1020,10 @@ export function MultiSelectCell<TData>({
10171020 const containerRef = React . useRef < HTMLDivElement > ( null ) ;
10181021 const inputRef = React . useRef < HTMLInputElement > ( null ) ;
10191022 const cellOpts = cell . column . columnDef . meta ?. cell ;
1020- const options = cellOpts ?. variant === "multi-select" ? cellOpts . options : [ ] ;
1023+ const options = React . useMemo (
1024+ ( ) => ( cellOpts ?. variant === "multi-select" ? cellOpts . options : [ ] ) ,
1025+ [ cellOpts ] ,
1026+ ) ;
10211027 const optionByValue = React . useMemo (
10221028 ( ) => new Map ( options . map ( ( option ) => [ option . value , option ] ) ) ,
10231029 [ options ] ,
You can’t perform that action at this time.
0 commit comments