@@ -2,28 +2,27 @@ 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" ;
5+ import useLayoutEffect from ' rc-util/lib/hooks/useLayoutEffect' ;
66import Item from './Item' ;
77import { useBatchFrameState } from './hooks/useBatchFrameState' ;
88import RawItem from './RawItem' ;
99
10- export const OverflowContext =
11- React . createContext < {
12- prefixCls : string ;
13- responsive : boolean ;
14- order : number ;
15- registerSize : ( key : React . Key , width : number | null ) => void ;
16- display : boolean ;
10+ export const OverflowContext = React . createContext < {
11+ prefixCls : string ;
12+ responsive : boolean ;
13+ order : number ;
14+ registerSize : ( key : React . Key , width : number | null ) => void ;
15+ display : boolean ;
1716
18- invalidate : boolean ;
17+ invalidate : boolean ;
1918
20- // Item Usage
21- item ?: any ;
22- itemKey ?: React . Key ;
19+ // Item Usage
20+ item ?: any ;
21+ itemKey ?: React . Key ;
2322
24- // Rest Usage
25- className ?: string ;
26- } > ( null ) ;
23+ // Rest Usage
24+ className ?: string ;
25+ } > ( null ) ;
2726
2827const RESPONSIVE = 'responsive' as const ;
2928const INVALIDATE = 'invalidate' as const ;
@@ -231,7 +230,12 @@ function Overflow<ItemType = any>(
231230 }
232231
233232 for ( let i = 0 ; i < len ; i += 1 ) {
234- const currentItemWidth = getItemWidth ( i ) ;
233+ let currentItemWidth = getItemWidth ( i ) ;
234+
235+ // Fully will always render
236+ if ( fullySSR ) {
237+ currentItemWidth = currentItemWidth || 0 ;
238+ }
235239
236240 // Break since data not ready
237241 if ( currentItemWidth === undefined ) {
0 commit comments