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?
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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