Note: The Guide is still only an outline. Pull Requests would be greatly appreciated!
Junctions is a single tool for converting between Routes and Locations – and that’s it. But while this gives you a huge amount of flexibility, it can also leave you scratching your head as to the best way to use it.
Screen Components are a solution to this. They’re a pattern for components which specify junctions and consume matching routes. And while they still give you flexibility to use Junctions whichever way you see fit, they take the guesswork out of getting started.
So what do Screen components look like?
child, if it exists, is passed to a child screen
Let’s go over this example one step at a time
propTypes, this specifies the types which can be passed in
propTypes, it is actually used at runtime in production:
junctionproperty, composing screens becomes simply a matter of passing that junction to our junction branch’s
route.childthrough to the child Screen’s
route.childwill differ based on which branch is currently active, so regardless of which child component you’re rendering for the current route, its children will still be