Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update custom-navigators.md : Add missing variable #1412

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ahmed-khlifi
Copy link

In the TabNavigator example , isFocused Variable is using index variable to validate the condition.
However, the index variable is not defined which cause an error of no existing variable.
old example :

state.routes.map((route) => ( // missing index
          <Pressable
            key={route.key}
            onPress={() => {
              const isFocused = state.index === index; // using undefined variable
...........
              }); 
           ..........

In the TabNavigator example , isFocused Variable is using "index" variable to validate the condiation. However, in state.routes.map((route)...) the index variable is not defined which cause an error of no existing variable.
Copy link

netlify bot commented Feb 22, 2025

Deploy Preview for react-navigation-docs ready!

Name Link
🔨 Latest commit 61548af
🔍 Latest deploy log https://app.netlify.com/sites/react-navigation-docs/deploys/67ba4f05584c29000870585a
😎 Deploy Preview https://deploy-preview-1412--react-navigation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant