Jacse / react-native-app-intro-slider

Simple and configurable app introduction slider for react native
MIT License
1.66k stars 330 forks source link

Feature: Allow setting the activeIndex via props #208

Open pke opened 4 years ago

pke commented 4 years ago

It would be nice to be able to set the activeIndex to some specific (clamped) index for advanced usage.

I am currently using an effect to goToSlide but this does not update the activeDots and next and done buttons.

const { id } = props
const ref = useRef<AppIntroSlider>(null)
useEffect(() => {
  ref.current && ref.current.goToSlide(id)
}, [id, ref]