react-navigation / react-navigation/react-navigation.github.io

In "Help" page witgh presentation set value to "transparentModal", I want push one new Page of name "Profile", How shuld i do?

Open
#1,262 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
324
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

import * as React from 'react';
import { Button, View, Text } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

function Home({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
Home Screen
<Button onPress={() => navigation.navigate('Help')} title="Go to Help" />
<Button
onPress={() => navigation.navigate('Profile')}
title="Go to Profile"
/>

);
}

function Help({ navigation }) {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
Help Screen
<Button onPress={() => navigation.push('Profile')} title="Go to Home2" />
<Button onPress={() => navigation.navigate('Invite')} title="Invite" />

);
}

function EmptyScreen() {
return ;
}

const Stack = createNativeStackNavigator();

function App() {
const isLoggedIn = true;

return (

<Stack.Navigator>
{isLoggedIn ? (
// Screens for logged in users
<Stack.Group>
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Profile" component={EmptyScreen} />
</Stack.Group>
) : (
// Auth screens
<Stack.Group screenOptions={{ headerShown: false }}>
<Stack.Screen name="SignIn" component={EmptyScreen} />
<Stack.Screen name="SignUp" component={EmptyScreen} />
</Stack.Group>
)}
{/* Common modal screens */}
<Stack.Group screenOptions={{ presentation: 'transparentModal' }}>
<Stack.Screen name="Help" component={Help} />
<Stack.Screen name="Invite" component={EmptyScreen} />
</Stack.Group>
</Stack.Navigator>

);
}

export default App;

In "Help" page, I want push one new Page of name "Profile", How shuld i do?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided Stack.Navigator example and its Help, Profile, and screen-group declarations. Determine which documentation page should explain this navigation case and what expected configuration or usage should be shown. Done means the documented example clearly explains how to reach Profile from Help; the issue names no repository file or test to update.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, react-native
Domain
documentation, mobile
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.