navigate to another screen react native code example
Example 1: flutter navigate to new screen
// Within the `FirstRoute` widget
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SecondRoute()),
);
}
Example 2: navigation in react native
import { useNavigation } from '@react-navigation/native';
const navigation = useNavigation();
navigation.navigate('WallScreen')
Example 3: react native navigate two screens back
navigation.pop(n);
// n = number of screens to go back.