@@ -2,28 +2,27 @@ import * as React from 'react';
2
2
import { useState , useMemo , useCallback } from 'react' ;
3
3
import classNames from 'classnames' ;
4
4
import ResizeObserver from 'rc-resize-observer' ;
5
- import useLayoutEffect from " rc-util/lib/hooks/useLayoutEffect" ;
5
+ import useLayoutEffect from ' rc-util/lib/hooks/useLayoutEffect' ;
6
6
import Item from './Item' ;
7
7
import { useBatchFrameState } from './hooks/useBatchFrameState' ;
8
8
import RawItem from './RawItem' ;
9
9
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 ;
17
16
18
- invalidate : boolean ;
17
+ invalidate : boolean ;
19
18
20
- // Item Usage
21
- item ?: any ;
22
- itemKey ?: React . Key ;
19
+ // Item Usage
20
+ item ?: any ;
21
+ itemKey ?: React . Key ;
23
22
24
- // Rest Usage
25
- className ?: string ;
26
- } > ( null ) ;
23
+ // Rest Usage
24
+ className ?: string ;
25
+ } > ( null ) ;
27
26
28
27
const RESPONSIVE = 'responsive' as const ;
29
28
const INVALIDATE = 'invalidate' as const ;
@@ -231,7 +230,12 @@ function Overflow<ItemType = any>(
231
230
}
232
231
233
232
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
+ }
235
239
236
240
// Break since data not ready
237
241
if ( currentItemWidth === undefined ) {
0 commit comments