redux-router-scroll-restoration

1.0.1 • Public • Published

Scroll restoration

Simple middleware for scroll restoration.

Install

npm i -S redux-router-scroll-restoration

or

yarn add redux-router-scroll-restoration

Usage

import { createStore, applyMiddleware } from 'redux'
import { routerMiddleware } from 'react-router-redux'
import createHistory from 'history/createBrowserHistory'
import scrollRestorationMiddleware from 'redux-router-scroll-restoration'
import rootReducer from './reducer'

const history = createHistory()
const initialState = {}

const store = createStore(
  rootReducer,
  initialState,
  applyMiddleware(
    routerMiddleware(history),
    scrollRestorationMiddleware
  )
)

Package Sidebar

Install

npm i redux-router-scroll-restoration

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

2.56 kB

Total Files

4

Last publish

Collaborators

  • dimalolzet