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

Code samples don't match up what's with on Snack sample

Open
#729 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

The following code snippet here:

https://reactnavigation.org/docs/modal

under create modal stack - does not match with the code snippet on the linked snack example:

https://snack.expo.io/?platform=android&name=Navigation%20lifecycle%20%7C%20React%20Navigation&dependencies=%40react-native-community%2Fmasked-view%40%5E0.1.1%2C%40react-navigation%2Fnative%40%5E5.0.5%2C%40react-navigation%2Fbottom-tabs%40%5E5.0.5%2C%40react-navigation%2Fdrawer%40%5E5.0.5%2C%40react-navigation%2Fmaterial-bottom-tabs%40%5E5.0.5%2C%40react-navigation%2Fmaterial-top-tabs%40%5E5.0.5%2C%40react-navigation%2Fstack%40%5E5.0.5%2Creact-native-gesture-handler%401.5.2%2Creact-native-reanimated%401.4.0%2Creact-native-safe-area-context%400.6.0%2Creact-native-screens%402.0.0-alpha.12&sourceUrl=https%3A%2F%2Freactnavigation.org%2Fexamples%2F5.x%2Ffull-screen-modal.js

For example, the following line in the docs:

function RootStackScreen() {
  return (
    <RootStack.Navigator mode="modal">
      <RootStack.Screen
        name="Main"
        component={MainStackScreen}
        options={{ headerShown: false }}
      />
      <RootStack.Screen name="MyModal" component={ModalScreen} />
    </RootStack.Navigator>
  );
}

does not exist in the Snack example. It should probably reflect the same code so as not to be confusing to new users.

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

Compare the modal page at reactnavigation.org/docs/modal with the linked Snack example and its source URL. Start by checking the create modal stack snippet against the Snack code; done means the documentation and example show the same implementation or clearly explain any intentional difference.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.