Skip to content

Commit

Permalink
bump version 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bySabi committed Mar 31, 2018
1 parent 21ffd44 commit 3cc81b2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"presets": ["es2015", "stage-3", "react"],
"presets": ["env", "stage-3", "react"],
"plugins": [
"transform-class-properties",
"transform-object-rest-spread",
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## master (unreleased)

## 4.3.0
## 5.0.0

- Add support for React 16.3.x new API
- Prevent warning on React 16.3.x deprecated `componentWillReceiveProps`
Expand Down
12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-scrollchor",
"version": "4.3.0",
"version": "5.0.0",
"description": "A React component for scroll to #hash links with smooth animations",
"files": [
"lib"
Expand Down Expand Up @@ -30,25 +30,21 @@
"animate"
],
"peerDependencies": {
"react": ">=15.0.0",
"fbjs": "*"
"react": ">=15.0.0"
},
"dependencies": {
"requestanimationframe-timer": "^1.0.2"
"requestanimationframe-timer": "1.x.x"
},
"devDependencies": {
"babel-cli": "6.x.x",
"babel-eslint": "7.x.x",
"babel-plugin-transform-class-properties": "6.x.x",
"babel-plugin-transform-export-extensions": "6.x.x",
"babel-plugin-transform-object-rest-spread": "6.x.x",
"babel-preset-es2015": "6.x.x",
"babel-preset-env": "1.x.x",
"babel-preset-react": "6.x.x",
"babel-preset-stage-3": "6.x.x",
"fbjs": "*",
"mkdirp": "*",
"prop-types": "15.x.x",
"react": "16.x.x",
"rimraf": "2.x.x",
"semistandard": "*",
"snazzy": "7.x.x"
Expand Down
11 changes: 4 additions & 7 deletions src/scrollchor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export default class Scrollchor extends React.Component {
super(props);
this.state = Scrollchor._stateHelper(props);
this.simulateClick = this._handleClick;
isReact16_3() && delete Scrollchor.prototype.componentWillReceiveProps;
}

static propTypes = {
Expand Down Expand Up @@ -72,9 +71,7 @@ function easeOutQuad (x, t, b, c, d) {
return -c * (t /= d) * (t - 2) + b;
}

// Check for React version 16.3.x and beyond
function isReact16_3 () { // eslint-disable-line camelcase
const reSemver = /^v?((\d+)\.(\d+)\.(\d+))(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?(?:\+([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?$/; // eslint-disable-line no-useless-escape
const [,, major, minor] = reSemver.exec(React.version);
return major >= 16 && minor >= 3;
}
// Setup for React version 16.3.x and beyond
const reSemver = /^v?((\d+)\.(\d+)\.(\d+))(?:-([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?(?:\+([\dA-Za-z\-]+(?:\.[\dA-Za-z\-]+)*))?$/; // eslint-disable-line no-useless-escape
const [,, major, minor] = reSemver.exec(React.version);
major >= 16 && minor >= 3 && delete Scrollchor.prototype.componentWillReceiveProps;

0 comments on commit 3cc81b2

Please sign in to comment.