diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d82985..0282707 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## master (unreleased) +## 3.0.0 + +- Add React 15.5.x support +- Deprecate React 0.14 peer dependencie + ## 2.2.0 - Add beforeAnimate/afterAnimate hooks to scroll handler diff --git a/README.md b/README.md index b74b4db..7613fcc 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,7 @@ npm install react-scrollchor --save ### Dependencies * User should provide its own `React` package -* on `npm 2` enviroments, package [fbjs](https://www.npmjs.com/package/fbjs) should be installed too: -```bash -npm install fbjs --save -``` + #### `fbjs` package [fbjs](https://www.npmjs.com/package/fbjs) is a collection of utility libraries created by React Team. It include useful modules like `warning` and `invariant` diff --git a/package.json b/package.json index 3bd1fc5..b585a4a 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,9 @@ ], "repository": "https://github.com/bySabi/react-scrollchor.git", "main": "lib/scrollchor.js", + "engines": { + "npm": ">=3.0" + }, "scripts": { "build-npm": "rimraf lib && mkdirp lib && babel src/ -d lib/", "lint": "eslint . --ext .js,.jsx", @@ -27,7 +30,7 @@ "author": "bySabi Files", "license": "ISC", "peerDependencies": { - "react": "^15.0.0", + "react": ">=15.0.0", "fbjs": "*" }, "devDependencies": { diff --git a/src/scrollchor.jsx b/src/scrollchor.jsx index dc1b64b..7a7ee71 100644 --- a/src/scrollchor.jsx +++ b/src/scrollchor.jsx @@ -26,6 +26,13 @@ export default class Scrollchor extends React.Component { afterAnimate: PropTypes.func }; + componentWillReceiveProps ({ animate }) { + const { + offset = 0, duration = 400, easing = easeOutQuad + } = animate || {}; + this._animate = { offset, duration, easing }; + } + handleClick = (event) => { this._beforeAnimate(event); event.preventDefault();