Skip to content

React 15.5 migration #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
},
"homepage": "https://github.com/taion/react-router-scroll#readme",
"dependencies": {
"prop-types": "^15.5.6",
"scroll-behavior": "^0.9.1",
"warning": "^3.0.0"
},
Expand Down Expand Up @@ -69,8 +70,8 @@
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^1.8.0",
"mocha": "^3.1.2",
"react": "^15.3.2",
"react-dom": "^15.3.2",
"react": "^15.5.3",
"react-dom": "^15.5.3",
"react-router": "^2.8.1",
"rimraf": "^2.5.4",
"sinon": "^1.17.6",
Expand Down
9 changes: 5 additions & 4 deletions src/ScrollBehaviorContext.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import PropTypes from 'prop-types';
import React from 'react';
import ScrollBehavior from 'scroll-behavior';

import StateStorage from './StateStorage';

const propTypes = {
shouldUpdateScroll: React.PropTypes.func,
routerProps: React.PropTypes.object.isRequired,
children: React.PropTypes.element.isRequired,
shouldUpdateScroll: PropTypes.func,
routerProps: PropTypes.object.isRequired,
children: PropTypes.element.isRequired,
};

const childContextTypes = {
scrollBehavior: React.PropTypes.object.isRequired,
scrollBehavior: PropTypes.object.isRequired,
};

class ScrollBehaviorContext extends React.Component {
Expand Down
9 changes: 5 additions & 4 deletions src/ScrollContainer.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import PropTypes from 'prop-types';
import React from 'react';
import ReactDOM from 'react-dom';
import warning from 'warning';

const propTypes = {
scrollKey: React.PropTypes.string.isRequired,
shouldUpdateScroll: React.PropTypes.func,
children: React.PropTypes.element.isRequired,
scrollKey: PropTypes.string.isRequired,
shouldUpdateScroll: PropTypes.func,
children: PropTypes.element.isRequired,
};

const contextTypes = {
// This is necessary when rendering on the client. However, when rendering on
// the server, this container will do nothing, and thus does not require the
// scroll behavior context.
scrollBehavior: React.PropTypes.object,
scrollBehavior: PropTypes.object,
};

class ScrollContainer extends React.Component {
Expand Down