Skip to content
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

feat: Expose the components making up the ionic react router or expose the internals for fine grained control #30086

Open
3 tasks done
csotiMatyas opened this issue Dec 16, 2024 · 1 comment
Labels

Comments

@csotiMatyas
Copy link

Prerequisites

Describe the Feature Request

Exposing the components would make, recreating the router with our own specific needs. ( Without just copy pasting out everything from the 2 libraries: ionic/react and ionic/react-router ).

Exposing everything that the router currently provides would also cover, i believe ,most of what we would expect a mobile navigation would be.

Describe the Use Case

A mobile only app, could leverage the memory router instead of the browser router ( i just realized this is even an option, why is this not mentioned anywhere in the docs ), and have the fine grained control that is required to simulate the native navigation ( we all know that the browser router is NOT suitable at all for mobile navigation ). What i would need currently is a way to clear the navigation stack, and clear inbetween pages.
An example flow, a letter represent a page on the DOM / nav stack : A -> B -> C ; A -> B -> D; A -> B -> D -> E ->; A -> B -> D -> F;

After the first replace from C to D, A and B should be cleared from the stack, or at the end of the flow when E is replaced with F then clear the whole thing.
Another flow is just simply logging out, there can be a lot of pages still in the nav stack / on the DOM, that make absolutely no sense, and if you have a flow that uses a replace action but a page is still on the dom after logging out, navigation wil not happen or you can go back to pages and a likes.

Describe Preferred Solution

No response

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Dec 16, 2024
@csotiMatyas csotiMatyas changed the title feat: Expose the component making up the ionic react router or expose the internals. feat: Expose the components making up the ionic react router or expose the internals for fine grained control Dec 16, 2024
@csotiMatyas
Copy link
Author

csotiMatyas commented Dec 16, 2024

Expanding on this, adding a "navigation extras" to the push method would also be nice, as there are times when you would need to send even functions from one page to another page, not just search params ( i think the angular router supports / supported this at a point );

Fixing the result of the useIonRouter to the page its used in. You are on page A you go to page B, if you had search params on page A, now you do not have them anymore since useIonRouter will always reflect the current route's state, you change back to page A, you have them again. Page A should not do any work in the background in this regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant