If any of notPattern(s) match or notExactPattern(s) match exactly, then it will not render the component.
If any of the pattern(s) match or exactPattern(s) match exactly, or there are none, then it will render the component.
If register={false}
is given, it will not register any match on context, and child <Match>
components will match on
the same tail of the pathname (rather than the remainder after what was matched).
const InAppShell = (): React.Element<any> => (
<AppShell>
<Match exactPattern="/" component={Home} />
<Match pattern="/about" component={About} />
<Match pattern="/contact" component={Contact} />
</AppShell>
)
const App = (): React.Element<any> => (
<div>
<Match exactPattern="/" patterns={["/about", "/contact"]} register={false} component={InAppShell} />
<Match notExactPattern="/" notPatterns={["/about", "/contact"]} register={false} component={NotFound} />
</div>
)