Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[changed] Don't update scroll if only query has changed
Previously, the only way to opt out of scroll updates for a route would be by using `ignoreScrollBehavior`. This, however, made it hard to implement arguably the most common use case: resetting scroll when `params` change and preserving it when only `query` changes. This commit completely disables scroll updates when only `query` has changed. This provides a reasonable default behavior and leaves `ignoreScrollBehavior` for more complicated cases. If you'd rather keep the old behavior and reset scroll on query changes, you can either promote `query` variables to be route `params` or reset scroll position yourself in response to `query` changes in route handler's `componentDidUpdate`. Fixes remix-run#432, remix-run#439
- Loading branch information