How to use the @react-navigation/native.CommonActions.navigate function in @react-navigation/native

To help you get started, we’ve selected a few @react-navigation/native 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 / navigation-ex / packages / bottom-tabs / src / views / BottomTabBar.tsx View on Github external
const onPress = () => {
                const event = navigation.emit({
                  type: 'tabPress',
                  target: route.key,
                });

                if (!focused && !event.defaultPrevented) {
                  navigation.dispatch({
                    ...CommonActions.navigate(route.name),
                    target: state.key,
                  });
                }
              };
github berty / berty / js / packages / navigation / hook.ts View on Github external
reset: (type: string) => {
			if (type === 'Onboarding') {
				dispatch(
					CommonActions.reset({
						routes: [{ name: Routes.Onboarding.GetStarted }],
					}),
				)
				dispatch(CommonActions.navigate(Routes.Main.Home))
			} else {
				dispatch(
					CommonActions.reset({
						routes: [{ name: Routes.Main.Home }],
					}),
				)
				dispatch(CommonActions.navigate(Routes.Onboarding.GetStarted))
			}
		},
		navigate: {
github berty / berty / js / packages / navigation / hook.ts View on Github external
reset: (type: string) => {
			if (type === 'Onboarding') {
				dispatch(
					CommonActions.reset({
						routes: [{ name: Routes.Onboarding.GetStarted }],
					}),
				)
				dispatch(CommonActions.navigate(Routes.Main.Home))
			} else {
				dispatch(
					CommonActions.reset({
						routes: [{ name: Routes.Main.Home }],
					}),
				)
				dispatch(CommonActions.navigate(Routes.Onboarding.GetStarted))
			}
		},
		navigate: {
github berty / berty / js / packages / components / main / home / Requests.tsx View on Github external
onPress={() => {
						if (conversationPublicKey) {
							dispatch(
								CommonActions.navigate({
									name: Routes.Chat.OneToOne,
									params: {
										convId: conversationPublicKey,
									},
								}),
							)
						}
					}}
				>
github berty / berty / js / packages / components / chat / MultiMember.tsx View on Github external
onSwipeLeft={() =>
								isSwipe &&
								dispatch(
									CommonActions.navigate({
										name: Routes.Chat.MultiMemberSettings,
										params: { convId: params?.convId },
									}),
								)
							}
github berty / berty / js / packages / components / chat / OneToOne.tsx View on Github external
onSwipeLeft={() =>
								isSwipe &&
								dispatch(
									CommonActions.navigate({
										name: Routes.Chat.OneToOneSettings,
										params: { convId: params?.convId },
									}),
								)
							}
github berty / berty / js / packages / components / main / home / Search.tsx View on Github external
onPress={() =>
				!conv
					? data.state === beapi.messenger.Contact.State.IncomingRequest
						? navigate.main.contactRequest({ contactId: data.publicKey })
						: null
					: dispatch(
							CommonActions.navigate({
								name:
									conv.type === beapi.messenger.Conversation.Type.ContactType
										? Routes.Chat.OneToOne
										: Routes.Chat.Group,
								params: {
									convId: convPk,
									scrollToMessage: kind === SearchResultKind.Interaction && inte ? inte.cid : null,
								},
							}),
					  )
			}
github berty / berty / js / packages / components / main / home / Conversations.tsx View on Github external
: () =>
							dispatch(
								CommonActions.navigate({
									name: Routes.Chat.OneToOne,
									params: {
										convId: publicKey,
									},
								}),
							)
			}