react-navigation / react-navigation/react-navigation.github.io
elements left in stack
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 324
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
I want to check number of elements in my react navigation stack. if there was only one screen left and user press back button, application show them a message to exit the app. I had to use BackHandler in all of my screens because I hadn't had found a property which could show elements in stack.
this is my routes
const route1= {
screen1,
screen2
};
const route2= {
screen3,
screen4
};
export const stack1= createStackNavigator(route1);
export const stack2= createStackNavigator(route2);
export default {stack1, stack2};
this is my navigator
createNavigator = (routeName, params) => {
this.navigator = createAppContainer(createSwitchNavigator(routes, { initialRouteName: routeName, initialRouteParams: params }));
}
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 by reviewing the createStackNavigator and createSwitchNavigator entry points shown in the issue, along with React Native's BackHandler context. Determine whether the documentation should explain how to detect a single remaining screen and handle the exit prompt; done means the supported approach is documented with an example matching the stack1/stack2 setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react, react-native
- Domain
- documentation, mobile-dev
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100