-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: closing modal through ide url panel #316
fix: closing modal through ide url panel #316
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sending this. It looks ok, however I think it'd be easier to just add the same code in both v2 and v3 implementation rather than extracting it out. There is already some code duplication and we aim to have as few runtime files as possible. On top of that we will likely phase out v2 implementation so it wouldn't make any sense once we only have one in place.
44f7255
to
786cc06
Compare
Thanks for this, it will go out in the next update |
In #316 we introduced a regression with expo-router v2 integration. The used `router.navigate` method is only available in v3 and hence we revert that modification change for expo-router v2 plugin. This PR effectively reverts changes from #316 made to packages/vscode-extension/lib/expo_router_v2_plugin.js file
The problem:
Currently, navigating to another page is impossible if a modal is opened. The root cause of the problem is using
router.push
that does not dismiss modals. You can read more about it.expo/expo#26922 (comment) .
However approaches that they proposed aren't good because they introduce other bugs such as unnecessarily closing modals, because of this - thanks to @kmagiera catch (#204 (comment)) I eventually bet on
navigate
combined withsetParams
. This approach works smoothly without introducing additional problems.Before:
Screen_Recording_2024-05-03_at_11.54.50.mov
By replacing the current implementation with
navigate
andsetParams
we can eliminate the problem.After:
now.mov