Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function Profile({ navigation }) {
return (
onPress={() => navigation.navigate('Settings')}
/>
<button title="Go back"> navigation.goBack()} />
);
}
function Settings({ navigation }) {
return (
</button><button title="Go back"> navigation.goBack()} />
);
}
const Stack = createNativeStackNavigator();
function MyStack() {
return (
</button>
>
Push article
<button mode="outlined"> navigation.goBack()}
style={styles.button}
>
Go back
</button>
);
const NativeStack = createNativeStackNavigator();
type Props = {
navigation: StackNavigationProp;
};
export default function NativeStackScreen({ navigation }: Props) {
navigation.setOptions({
headerShown: false,
});
useFocusEffect(
React.useCallback(() => {
const drawer = navigation.dangerouslyGetParent() as DrawerNavigationProp<
ParamListBase
>;