New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-router-scroll-behavior

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router-scroll-behavior

Scroll behaviors for use with [react-router](https://github.com/reactjs/react-router). Based on [scroll-behavior](https://github.com/taion/scroll-behavior).

latest
npmnpm
Version
0.0.1-beta2
Version published
Weekly downloads
6
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

react-router-scroll-behavior

Scroll behaviors for use with react-router. Based on scroll-behavior.

What's the problem of scroll-behavior?

scroll-behavior and react-router are all rely on history and listen the location change. But react-router route components by using setState which is asynchronous. So that scroll behaviors may happen before routing finished.

Installation

$ npm i react-router-scroll-behavior --save

Usage

import React from 'react'
import { render } from 'react-dom'
import { Router, browserHistory } from 'react-router'
import { RouterScrollContext } from 'react-router-scroll-behavior'

// Render `Router` with RouterScrollContext
render((
  <Provider store={store} key="provider">
    <Router render={(props) => <RouterScrollContext {...props}/>} history={browserHistory}>
      ...routes
    </Router>
  </Provider>
), dest)

FAQs

Package last updated on 23 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts