How do I make a Flatlist navigate to the next screen when a row is clicked inside the Flatlist in react-native?
Edited: I posted all the codes inside my
i have simple example for that :
//Tasks Component
const Tasks = (props) => {
const { navigate } = props.navigation;
//function to go to next screen
goToNextScreen = () => {
return navigate('Detail');
}
return (
{
return(
this.goToNextScreen()}>
{item.key}
)
}
}
/>
);
}
//example for detail screen
const Detail = (props) => {
const { navigate } = props.navigation;
return(
Detail Screen
);
}
//initial screen
const App = StackNavigator({
Tasks: {screen: Tasks},
Detail: {screen: Detail},
})
maybe can help you, thanks :)