framework7

Open full view…

Framework7, React, Cordova. Going back several times.

Dmitriy
Tue, 08 Aug 2017 22:36:37 GMT

Hey everyone, I'm working on a Cordova app, using F7+React, and having a bit of a trouble working with F7's navigation history. The app is structured in such a way that users land on HomeComponent (route "/") page at start up. They can go through an A>B>C wizard type-of-deal, each step pushes new Page/Component onto a backstack. When they reach the last step, I would like to navigate back to a certain point in history, further than one page away from the current one. Say, I'd like to land back on component "A", skipping everything in-between. I don't want to push new "/a" history entry, in order to keep my navbar back button predictable, i.e. it would lead to "Home" instead of back to "C". TL;DR: I need a way to pop several states off of backstack, so after "Home>A>B>C" workflow it gets trimmed down to "Home>A" state, without breaking everything. I got a little pseudo-code going at https://gist.github.com/dmitriy-shmilo/07654a32837c66214b045df036c31bfb, just in case.

Dmitriy
Thu, 10 Aug 2017 11:51:29 GMT

I think that I'm tackling this problem from a wrong angle. I think I should group my wizard steps into a single view, instead of trying to achieve everything with pages. Something like this: `MainView:Home > MainView:A > SecondaryView:B > SecondaryView:C > Pop secondary view`. This will return my state to the `Home>A` situation, just as I'd like it to. Now I only have to figure out how to code this declaratively.