@@ -549,7 +549,7 @@ export const Methods = () => {
549
549
550
550
return (
551
551
< Container >
552
- < Title > Methods { '&' } Properties</ Title >
552
+ < Title > Methods & Properties </ Title >
553
553
< Hr />
554
554
< ListWrapper >
555
555
< strong > 5</ strong > methods and < strong > 1</ strong > property are exposed to
@@ -699,20 +699,15 @@ export const Filtering = () => {
699
699
} ;
700
700
701
701
export const Virtualization = ( ) => {
702
+ const selectRef = useRef < SelectRef | null > ( null ) ;
702
703
const optionCountList = useMemo ( ( ) => [ 100 , 1000 , 10000 , 25000 , 50000 , 100000 ] , [ ] ) ;
703
704
const [ optionsCount , setOptionsCount ] = useState ( optionCountList [ 0 ] ) ;
704
- const [ options , setOptions ] = useState < Option [ ] > ( [ ] ) ;
705
- const selectRef = useRef < SelectRef | null > ( null ) ;
705
+ const options = useMemo < Option [ ] > ( ( ) => createSelectOptions ( optionsCount ) , [ optionsCount ] ) ;
706
706
707
707
useUpdateEffect ( ( ) => {
708
708
selectRef . current ?. clearValue ( ) ;
709
709
} , [ options ] ) ;
710
710
711
- useEffect ( ( ) => {
712
- const nextSelectOptions = createSelectOptions ( optionsCount ) ;
713
- setOptions ( nextSelectOptions ) ;
714
- } , [ optionsCount ] ) ;
715
-
716
711
return (
717
712
< Container >
718
713
< Title > Menu List Virtualization</ Title >
@@ -744,7 +739,7 @@ export const Virtualization = () => {
744
739
open to performance optimizations - most notably, memoization.
745
740
Simple components that rely on the props passed to it (rather than
746
741
its own managed state) to generate its JSX are likely candidates for
747
- memoization (testing { '&' } debugging becomes much easier as well).
742
+ memoization (testing & debugging becomes much easier as well ) .
748
743
</ Li >
749
744
</ List >
750
745
< em > Note: </ em > Potential performance degradation could be encountered during input
@@ -882,7 +877,8 @@ export const Portaling = () => {
882
877
const options = useMemo < Option [ ] > ( ( ) => createSelectOptions ( 3 ) , [ ] ) ;
883
878
884
879
const [ menuOpen , setMenuOpen ] = useState ( false ) ;
885
- const [ menuPortalTarget , setMenuPortalTarget ] = useState < Element | undefined > ( ) ;
880
+ const [ menuPortalTarget , setMenuPortalTarget ] = useState < HTMLElement | undefined > ( undefined ) ;
881
+
886
882
const onMenuOpen = useCallback ( ( ) => setMenuOpen ( true ) , [ ] ) ;
887
883
const onMenuClose = useCallback ( ( ) => setMenuOpen ( false ) , [ ] ) ;
888
884
@@ -910,7 +906,7 @@ export const Portaling = () => {
910
906
id = { portalId }
911
907
menuOpen = { menuOpen }
912
908
>
913
- < span > portal { '<' } div / { '>' } </ span >
909
+ < span > portal node </ span >
914
910
</ MenuPortalElement >
915
911
</ CardHeader >
916
912
< CardBody >
0 commit comments