-
Hi, Thanks for the awesome library and all your smart work! I have a question or maybe a suggestion. I ran into an issue with deep links, specifically with how Decompose processes configs. I know that configurations are compared using equals and hashCode. However, let's say I send deep link #1. The app initializes with it, passing the deep link into the config and its child configs. Then, we navigate through the app. But when I'm already in the app and receive the exact same deep link again, the navigator pushes it. Since the deep link is identical, nothing changes, and no recreation happens—we already have the configuration with the deep link in the constructor. Even if we navigated somewhere inside the app, the root tab navigation remains the same. Is there a way to force configuration recreation without using a workaround like adding a timestamp to the config constructor? If not, it would be great to have a parameter in the navigator’s .navigate method—something like forceRecreate: Boolean—which, when set to true, would trigger navigation even if the config being passed is the same as the one currently in the foreground. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Currently it's not possible to force-recreate child components, and this is by design. Configurations are compared strictly by equality, navigation is a function from the old state (e.g. old list of configurations) to a new state (e.g. new list of configurations). If you want to recreate you have to make the new configuration not equal to the old one. This can be done by adding a key property to the configuration class. This could be a UUID, etc. |
Beta Was this translation helpful? Give feedback.
Currently it's not possible to force-recreate child components, and this is by design. Configurations are compared strictly by equality, navigation is a function from the old state (e.g. old list of configurations) to a new state (e.g. new list of configurations). If you want to recreate you have to make the new configuration not equal to the old one. This can be done by adding a key property to the configuration class. This could be a UUID, etc.