Replies: 1 comment 6 replies
-
Which path will be displayed in the browser URL bar when you navigate to this screen if there are 2 different paths defined for the same screen? The example above is already possible with a single path: For more complex cases the proper approach is to have 2 screens instead of one. If you have a component with logic for 2 states, then reuse that component in both screens. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In our app, it's not uncommon to have a screen support both a new and edit state. For example, we have a Products Screen which can be deep linked to with the following paths
/products/${productId}
and/products/new
.Because our screen (Products) within the linking configuration object accepts an object and not an array, we can only assign a single path to a screen. I've seen the workarounds in #9328, but they feel a bit hacky and it's not scaleable in our large application.
I wanted to get your opinion on the following API where we pass an array to our screen instead of an object. I plan on trying to implement this approach this week.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions