Is there a navigation stack in Blazor?

Viewed 237

It's easy enough to use NavigationManager.NavigateTo() to move between pages, but I am wondering if there is a way to navigate to a page such that I can navigate back without losing state on the first page.

I'm looking for something like NavigationManager.Push("myurl"), and the corresponding Navigationmanager.Pop().

1 Answers

I'm afraid the answer is no... Currently Blazor does not support such features. Instead you may store your state in the local storage, and retrieved it when navigating back.

Consider posting an issue in github asking for such features, though I believe it has been done long before. There's an article about state by Steve Anderson in the docs...Review it for new features.

Related