diff --git a/package.json b/package.json index 8ae4cd9..f2b154c 100644 --- a/package.json +++ b/package.json @@ -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" }, @@ -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", diff --git a/src/ScrollBehaviorContext.js b/src/ScrollBehaviorContext.js index 1431bd8..00187fd 100644 --- a/src/ScrollBehaviorContext.js +++ b/src/ScrollBehaviorContext.js @@ -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 { diff --git a/src/ScrollContainer.js b/src/ScrollContainer.js index 812a2a9..0a2c1a4 100644 --- a/src/ScrollContainer.js +++ b/src/ScrollContainer.js @@ -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 {