@@ -68,6 +68,7 @@ const refreshActiveSlideAttribute = (slides: SlidesType[], activeSlide?: Editabl
6868
6969export const SwipeableContainer = ( props : SwipeableContainerProps ) : ReactElement => {
7070 const [ width , setWidth ] = useState ( 0 ) ;
71+ const [ height , setHeight ] = useState ( 0 ) ;
7172 const [ activeIndex , setActiveIndex ] = useState ( 0 ) ;
7273 const flashList = useRef < FlashListRef < any > > ( null ) ;
7374 const isInitializing = useRef ( true ) ;
@@ -124,9 +125,9 @@ export const SwipeableContainer = (props: SwipeableContainerProps): ReactElement
124125
125126 const renderItem = useCallback (
126127 ( { item } : any ) : ReactElement => {
127- return < View style = { [ { width } ] } > { item . content } </ View > ;
128+ return < View style = { [ { width } , { height } ] } > { item . content } </ View > ;
128129 } ,
129- [ width ]
130+ [ width , height ]
130131 ) ;
131132
132133 const renderButton = (
@@ -327,12 +328,17 @@ export const SwipeableContainer = (props: SwipeableContainerProps): ReactElement
327328 */
328329 const onLayout = useCallback (
329330 ( event : LayoutChangeEvent ) => {
330- const newWidth = event . nativeEvent . layout . width ;
331+ const layout = event . nativeEvent . layout ;
332+ const newWidth = layout . width ;
331333 if ( newWidth !== width ) {
332334 setWidth ( newWidth ) ;
333335 }
336+ const newHeight = layout . height ;
337+ if ( newHeight !== height ) {
338+ setHeight ( newHeight ) ;
339+ }
334340 } ,
335- [ width ]
341+ [ width , height ]
336342 ) ;
337343
338344 return (
0 commit comments