v2.3.0-alpha
absurdprofit
released this
18 Mar 22:45
·
251 commits
to main
since this release
V2.3.0-alpha
Features
- Added RegExp as possible path prop to
Stack.Screen
. Now you can create a route that matches multiple pathnames for example:
<Stack.Screen component={EmailPage} path={/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/} />
Will match any pathname that resembles an email. Unlike React Router V6 the order of components inside the Router component matters. Smart route matching should be in a future release.
- Path prop to
Stack.Screen
is now also optional meaning if you omit defining a valid path prop the component is only rendered when all other possible pathname matches fail. This would be useful for defining 404 pages for example.