react-native-animated-segment-control
react-native-animated-segment-control copied to clipboard
Added componentDidUpdate() to updated selectedIndex
When selectedIndex prop is changed the component doesn't update the selectedIndex state, the component then doesn't animate the segment to the updated position. To fix this I added componentDidUpdate which checks if the props changed, if they did I update the state and animate the segment to the new position.