Skip to content

Commit e6e29a0

Browse files
committed
Merge pull request #2493 from rackt/taion-patch-1
Point to scroll-behavior for scroll behaviors
2 parents ba04463 + 264d709 commit e6e29a0

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

UPGRADE_GUIDE.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,17 +304,24 @@ where you can get it now if you are **not** a route component (`this.context`).
304304
| `getPathname()` | `location.pathname` |
305305
| `getQuery()` | `location.search` |
306306
| `getQueryParams()`| `location.query` |
307-
| `isActive(to, params, query)` | `history.isActive(pathname, query, onlyActiveOnIndex)` |
307+
| `isActive(to, params, query)` | `history.isActive(pathname, query, indexOnly)` |
308308

309309
Note not all `State` functionality can be accessed via context in v1.0.
310310
For example, `params` is not available via context.
311311

312312
### Scrolling
313313

314-
In 0.13.x we had a couple of implementations to restore scroll position,
315-
we've realized that we can build a better implementation on top of the
316-
router and will be doing that very soon, before the 1.0 final release,
317-
but it doesn't need to be baked into routing like it was before.
314+
We're developing scroll behaviors separately in the
315+
[`scroll-behavior`](https://github.com/rackt/scroll-behavior)
316+
library until we have a stable, robust implementation that we're happy with.
317+
Currently, scroll behaviors are exposed there as history enhancers:
318+
319+
```js
320+
import createHistory from 'history/lib/createBrowserHistory'
321+
import useScroll from 'scroll-behavior/lib/useStandardScroll'
322+
323+
const history = useScroll(createHistory)()
324+
```
318325

319326
### `willTransitionTo` and `willTransitionFrom`
320327

0 commit comments

Comments
 (0)