How to use @react-navigation/native-stack - 3 common examples

To help you get started, we’ve selected a few @react-navigation/native-stack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github react-navigation / react-navigation.github.io / examples / next / native-stack-with-options.js View on Github external
onPress={() => navigation.navigate('Settings')}
      />
      <button title="Go back"> navigation.goBack()} /&gt;
    
  );
}

function Settings({ navigation }) {
  return (
    </button><button title="Go back"> navigation.goBack()} /&gt;
    
  );
}

const Stack = createNativeStackNavigator();

function MyStack() {
  return (
    
      </button>
github react-navigation / navigation-ex / example / src / Screens / NativeStack.tsx View on Github external
&gt;
        Push article
      
      <button mode="outlined"> navigation.goBack()}
        style={styles.button}
      &gt;
        Go back
      </button>
    
    
  
);

const NativeStack = createNativeStackNavigator();

type Props = {
  navigation: StackNavigationProp;
};

export default function NativeStackScreen({ navigation }: Props) {
  navigation.setOptions({
    headerShown: false,
  });

  useFocusEffect(
    React.useCallback(() =&gt; {
      const drawer = navigation.dangerouslyGetParent() as DrawerNavigationProp&lt;
        ParamListBase
      &gt;;

@react-navigation/native-stack

Native stack navigator using react-native-screens

MIT
Latest version published 10 days ago

Package Health Score

98 / 100
Full package analysis

Popular @react-navigation/native-stack functions