Feature: Global defaults for preserveScroll and preserveState #2492
weristwiegott
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Allow apps to configure global defaults so client-side navigations automatically use:
• preserveScroll: true
• preserveState: true
Motivation
Many apps (dashboards, CRUD heavy UIs, feed-like views) want a SPA feel by default:
• Keep component state between visits (forms, tabs, accordions).
• Don’t jump to top on every navigation.
Right now we have to repeat preserveScroll/preserveState:
• On every component
• Or every router.visit() call
This is noisy and error-prone, and teams inevitably forget it in some places.
Proposed API
Beta Was this translation helpful? Give feedback.
All reactions