I'm submitting a ... (check one with "x")
Current behavior:
ViewPager's View does not change when selectedIndex props change.
Swiping changes selectedIndex properly.
(Please check the gif below)
Expected behavior:
When change selectedIndex props(with Hooks/setState), ViewPager's View changes
Steps to reproduce:
stateRelated code:
import React, { useState } from 'react';
import { View } from 'react-native';
import { Text, ViewPager, Button } from 'react-native-ui-kitten';
export default function MainPage(){
const [pageIndex, setIndex] = useState(0);
const tabNames = ['a', 'b', 'c', 'd', 'e'];
return(
<View style={{flex: 1}}>
<View style={{flex: 0}}>
<Button onPress={()=>{setIndex(pageIndex - 1)}}> - </Button>
<Button onPress={()=>{setIndex(pageIndex + 1)}}> + </Button>
</View>
<ViewPager style={{flex: 1}}
selectedIndex={pageIndex}
onSelect={(number)=>{setIndex(number);}}>
{tabNames.map((item, index) => (
<View key={index}>
<Text>{item}, {index}</Text>
</View>
))}
</ViewPager>
<View style={{flex: 0}}>
<Text>{pageIndex}</Text>
</View>
</View>
)
};

Swiping works well, though.
I tried setState instead of hooks, the problem was same.
OS, device, package version
Android 9.0
React native 0.60.4
react-native-ui-kitten 4.1.0
Thanks for reporting this. Will take a look馃憤
@cereme we've got a working example in master branch. Will be published in version 4.2