react-native-scrollable-tab-view
react-native-scrollable-tab-view copied to clipboard
Refresh the component on every tab change
- [ YES ] I have searched existing issues
- [ YES ] I am using the latest scrollable tab view version
I want to know if there's a way to refresh the component on every tab change because componentDidMount doesn't re-invoke when we return to the rendered/previous tab (as it's already in the stack)
Try something like this:
`const [tabIndex, setTabIndex] = useState
React.useEffect(() => { setIsRefreshing(true) after fetching data setIsRefreshing(false) }, [tabIndex]);
<ScrollableTabView ... onChangeTab={(value) => { setTabIndex(value.i); }} ...</ScrollableTabView>`