File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed
Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2+ import useLayoutEffect from "rc-util/lib/hooks/useLayoutEffect" ;
23import Overflow from '../src' ;
34import '../assets/index.less' ;
45import './common.less' ;
@@ -63,7 +64,7 @@ const Demo = () => {
6364 const inputRef = React . useRef < HTMLInputElement > ( ) ;
6465 const measureRef = React . useRef < HTMLDivElement > ( ) ;
6566
66- React . useLayoutEffect ( ( ) => {
67+ useLayoutEffect ( ( ) => {
6768 setInputWidth ( measureRef . current . offsetWidth ) ;
6869 } , [ inputValue ] ) ;
6970
Original file line number Diff line number Diff line change 4646 "@babel/runtime" : " ^7.11.1" ,
4747 "classnames" : " ^2.2.1" ,
4848 "rc-resize-observer" : " ^1.0.0" ,
49- "rc-util" : " ^5.5.1 "
49+ "rc-util" : " ^5.15.0 "
5050 },
5151 "devDependencies" : {
5252 "@types/classnames" : " ^2.2.9" ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import * as React from 'react';
22import { useState , useMemo , useCallback } from 'react' ;
33import classNames from 'classnames' ;
44import ResizeObserver from 'rc-resize-observer' ;
5+ import useLayoutEffect from "rc-util/lib/hooks/useLayoutEffect" ;
56import Item from './Item' ;
67import { useBatchFrameState } from './hooks/useBatchFrameState' ;
78import RawItem from './RawItem' ;
@@ -215,7 +216,7 @@ function Overflow<ItemType = any>(
215216 return itemWidths . get ( getKey ( mergedData [ index ] , index ) ) ;
216217 }
217218
218- React . useLayoutEffect ( ( ) => {
219+ useLayoutEffect ( ( ) => {
219220 if ( mergedContainerWidth && mergedRestWidth && mergedData ) {
220221 let totalWidth = suffixWidth ;
221222
You can’t perform that action at this time.
0 commit comments