how do i use the index prop correctly?
the documentation for it is very sparse. please consider adding an example usage in the docs!
i made a state variable for it
const [index, setIndex] = useState(0)
then added it to the carousel:
<Carousel autoPlay={false} index={index} />
i have a useEffect that sets the index to be index 0 when my data length changes
useEffect(() => { setIndex(data.length <= 5 ? 0 : undefined) }, [data.length])
but the index isn't navigating to index 0, idk why
how do i use the index prop correctly? the documentation for it is very sparse. please consider adding an example usage in the docs!
i made a state variable for it
const [index, setIndex] = useState(0)
then added it to the carousel:
<Carousel autoPlay={false} index={index} />
i have a useEffect that sets the index to be index 0 when my data length changes
useEffect(() => { setIndex(data.length <= 5 ? 0 : undefined) }, [data.length])
but the index isn't navigating to index 0, idk why