Comments (3)
So since using navigator.navigate
instead of rendering a Navigate
, this error doesn't happen anymore. Still a little annoying but it is a good hack at least.
from swiftui-router.
Oh, forgot to mention it. Once the app is in this state, it does that all the time. So e.g. in this example the default route should go back to "/home/root" but instead, again, navigates to /home fallback (endless loop). That's why I don't even fallback but rather go to an empty screen because of SwiftUI's optimizations.
from swiftui-router.
Hmm it's very possible you're talking about a bug I've encountered very rarely - like only three times in total. Unfortunately so far I have been unable to successfully (and consistently) reproduce it.
The one time I did caught it, however, it looked like - for whatever reason - SwiftUI decided to render the children of SwitchRoutes
in reverse order. Like some weird magic optimization SwiftUI decided to perform out of nowhere. Meaning the last route would render (and perform path matching) first, instead of last. Thus resulting in the behaviour you described.
My gut tells me this is some optimization introduced in SwiftUI 3, as I don't recall experiencing this bug in SwiftUI 2. But it's hard to tell.
It is certainly worrying, and I really hope to find a method/routine to reproduce this bug consistently to further investigate it. Any help on this matter would be greatly appreciated!
So far from the top of my head potential solutions could be making a custom ViewBuilder for SwitchRoutes
(lord have mercy), or work with .id()
for Route
s views (yuck). 😞
from swiftui-router.
Related Issues (20)
- Nested routes without parent being rerendered on child navigation HOT 2
- How to use? HOT 2
- Set path on app launch HOT 2
- view init twice when navigate
- How to navigate to any page HOT 2
- Routes with missing optional parameters do not work without a trailing slash (/) HOT 3
- Flexible nested navigation HOT 2
- SwiftUIRouter using NavigationLink HOT 6
- Can't revisit a page HOT 2
- Full screen navigation without ignoring safe area
- Type safe routes HOT 4
- State of views from the back stack is not saved
- Able to switch to another tab then push to a certain view under navigation view then finally present a modal? HOT 1
- Switch between flows HOT 3
- Full screen navigation above tabView HOT 4
- `.opacity` transition not working HOT 2
- Keep paths loaded in memory for performance (e.g. in tab bar) HOT 2
- xcodebuild error HOT 2
- Navigating to a blank screen issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftui-router.