rackt/react-router — pull request #326 by gaearon (2014-09-29 00:06:13+00:00)
Title: [changed] Remove preserveScrollPosition, add scrollStrategy

>Note: This PR lacks docs

This removes support for `preserveScrollPosition` due to its unforunate naming.
Instead, we introduce three scrolling strategies:

* `none`: Router doesn't scroll the window when routes change
* `scrollToTop` (default): Router always scrolls to top when routes change
* `imitateBrowser`: Router tries to act like browser acts with server-rendered pages: it scrolls to top when clicking on links, but tries to restore position when navigating back and forward

You can only specify these on .
Per-route overrides are not supported, but you can supply a custom strategy object.

This also fixes #252.

Migration path:

The default changed from what corresponded to `imitateBrowser`, to `scrollToTop`.
If router's server-rendered scrolling imitation worked well for you, you must now specify it explicitly:

```
// before

// after

```

If you wish router to not try to manage scrolling, you must opt out:

```
// before

// after

```

Also, as a third option, you may now use the simple `scrollToTop` strategy.