File tree Expand file tree Collapse file tree 1 file changed +20
-21
lines changed
Expand file tree Collapse file tree 1 file changed +20
-21
lines changed Original file line number Diff line number Diff line change @@ -52,28 +52,27 @@ export const Carousel: FunctionComponent<CarouselProps> = (userProps: CarouselPr
5252 const autoSwipeTimer = useRef < number > ( ) ;
5353 const isNavigation = typeof props . navigation === 'function' ;
5454
55- if ( props . dynamic ) {
56- useEffect ( ( ) => {
57- const newItems = updateNodes (
58- itemsRef . current ,
59- props . children ,
60- prevChildren ,
61- props . slide ,
62- props . infinite ,
63- ) ;
55+ useEffect ( ( ) => {
56+ if ( props . dynamic ) return
57+ const newItems = updateNodes (
58+ itemsRef . current ,
59+ props . children ,
60+ prevChildren ,
61+ props . slide ,
62+ props . infinite ,
63+ ) ;
6464
65- setItems ( newItems ) ;
66- itemsRef . current = newItems ;
67- if (
68- page < props . pageCount &&
69- prevChildren &&
70- prevChildren ?. length < props . children . length
71- ) {
72- slide ( SlideDirection . Right ) ;
73- setPage ( page + 1 ) ;
74- }
75- } , [ props . children ] ) ;
76- }
65+ setItems ( newItems ) ;
66+ itemsRef . current = newItems ;
67+ if (
68+ page < props . pageCount &&
69+ prevChildren &&
70+ prevChildren ?. length < props . children . length
71+ ) {
72+ slide ( SlideDirection . Right ) ;
73+ setPage ( page + 1 ) ;
74+ }
75+ } , [ props . children ] ) ;
7776
7877 useEffect ( ( ) => {
7978 autoSwipe ( ) ;
You can’t perform that action at this time.
0 commit comments