stack navigation screen react native code example
Example 1: @react-navigation/native transition like ios
import {
CardStyleInterpolators,
createStackNavigator,
} from '@react-navigation/stack';
const Stack = createStackNavigator();
export default () => (
<Stack.Navigator
screenOptions={{
cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS
}}
>
<Stack.Screen name="Screen 1" component={ScreenComponent1} />
<Stack.Screen name="Screen 2" component={ScreenComponent2} />
</Stack.Navigator>
);
Example 2: navigation in react native
import { useNavigation } from '@react-navigation/native';
const navigation = useNavigation();
navigation.navigate('WallScreen')