Mocked example of Link without "from" behavior change #3106
+77
β6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π
After stubbing an example, it makes sense as to why things behave the way they do β It just caught me off guard (this changes existing behavior).
I have a layout-level component (a user navigation dropdown). My application spawn modals based on a search param,
modalId
. For example, I can be on/_layout/route-b
and click a link in the user dropdown (mounts inside_layout.tsx
) intended to stay on the current visible route with the only change being a modal spawned on top of the current content.I was triggering modals by way of
<Link to="." search={{(prev) => ({...prev, modalId: 'sign-out-confirmation' }) }} />
This worked up until
v1.81.9
. As ofv1.81.10
, I'm passing an extrafrom={undefined}
to retain the same behavior. Without this change, modals fall back to using the root.