0.1.5 • Published 9 years ago

use-scroll-behavior v0.1.5

Weekly downloads
9
License
MIT
Repository
github
Last release
9 years ago

use-scroll-behavior npm package Travis Coveralls

Scroll behaviors for use with history. Inspired by scroll-behavior and simplify the behavior.

Usage

Enhance your history object with this library to get standard scroll behavior after history changed.

import { browserHistory } from 'react-router';
import useScroll from 'use-scroll-behavior';
const history = useScroll(browserHistory);
// ...
export default class App extends Component {
  render() {
    return (
      <Router history={history}>
      //..your routes
      </Router>
    );
  }
}

Guide

Installation

$ npm install history use-scroll-behavior

Config

excludePath: regular Expression Array

set it if you do not want to set scroll position for some path.

const history = scrollBehavior(browserHistory, {
  excludePath: [/news\/id/],
});

TODO

  • add x position?
0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago