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

Document how to render conditional child navigation

オープン
#40 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

help wanted
主要言語
JavaScript
スター
324
フォーク
2k
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ドキュメントファイル、テスト、エントリポイントのいずれも指定されていません。まず既存のナビゲーションドキュメントと、報告されている wrapper コンポーネントによる回避策を確認し、次に条件付きの子ナビゲーターが Android の戻るボタンとどのように連携するかを検証してください。完了条件は、ユーザーデータに基づいてオンボーディングまたは機能ナビゲーションを選択するための、合意済みでサポートされているパターンを文書化することです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, react-native
領域
documentation, mobile-dev
issue の種類
ドキュメント
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。