react-navigation / react-navigation/react-navigation.github.io
Document how to render conditional child navigation
Personne n'a encore pris cette issue.
- Langage dominant
- JavaScript
- Étoiles
- 324
- Forks
- 2k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Hi. In my team we’ve struggled to implement conditional child navigation, where a branch of the navigation depends on user data (e.g. data in Redux and/or received from an API). In pseudo-code:
const Section1Default = StackNavigator(/* Some screens */)
const Section1Onboarding = StackNavigator(/* Different screens */)
const RootNavigator = TabNavigator({
section1: Section1Default OR Section1Onboarding,
section2: …,
section3: …
})
The idea is that when clicking on a specific tab, the user should see either a series of "onboarding" screens or the feature’s screens. (Both options are navigators themselves, but could be single screens too.)
@brentvatne & @ericvicenti Do you think that’s a use case worth addressing in the docs?
I think I could contribute a page section or a page on this, but I’m not sure what solution to offer.
So far we’ve only found hackish workarounds, such as: a wrapper component which has a StackRouter with the two navigation branches, and which navigates to the correct branch on willFocus. It works, but the trick falls short when using the Android back button.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Aucun fichier de documentation, test ou point d’entrée n’est indiqué. Commencez par examiner la documentation de navigation existante et le contournement signalé basé sur un composant wrapper, puis vérifiez comment les navigateurs enfants conditionnels interagissent avec le bouton Retour d’Android. Le travail est terminé lorsqu’un modèle convenu et pris en charge pour choisir la navigation d’onboarding ou de fonctionnalités à partir des données utilisateur est documenté.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript, react-native
- Domaine
- documentation, mobile-dev
- Type d'issue
- Documentation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100