react-navigation / react-navigation/react-navigation.github.io
Document how to render conditional child navigation
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 324
- Fork
- 2k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Non viene indicato alcun file di documentazione, test o punto di ingresso. Inizia esaminando la documentazione di navigazione esistente e il workaround segnalato basato su un componente wrapper, quindi verifica come i navigatori figli condizionali interagiscono con il pulsante Indietro di Android. Il lavoro è completato quando viene documentato un modello concordato e supportato per scegliere la navigazione di onboarding o delle funzionalità in base ai dati dell’utente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, react-native
- Ambito
- documentation, mobile-dev
- Tipo di issue
- Documentazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100