Skip to content

Commit 6eb92c1

Browse files
author
Jeffrey Luong
authored
Merge pull request #4 from button/jeffrey/upgrade-react
Upgrade react, react-dom, enzyme, sinon and install prop-types
2 parents 98ff893 + d19c2f1 commit 6eb92c1

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1+
* 2.0.0 November 7, 2019
2+
- Upgrade to support React 16+
3+
- Range [react-router](https://github.com/ReactTraining/react-router) to `^3.2.0` as peer dependency for React 16 support
4+
- Switch `React.PropTypes` to [prop-types](https://github.com/facebook/prop-types) as `React.PropTypes` has been deprecated.
5+
- Upgrade [enzyme](https://github.com/airbnb/enzyme) to `3.10.0`
6+
- Upgrade [sinon](https://github.com/sinonjs/sinon) to `7.5.0`
7+
18
* 1.0.0 January 19, 2017
29
- Initial Release

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ three things:
4343

4444
We support any browser supported by both [react](https://github.com/facebook/react) and [react-router](https://github.com/ReactTraining/react-router).
4545

46+
#### React 16 Support
47+
48+
Please note that as of `2.0.0` we provided React 16 support but with `react-router ^3.2.0` as a peer dependency. Since `react-router 4`, the Route architecture has changed significantly which means that using `react-simple-scroll` as a middleware is no longer compatible. We will work on a new version of `react-simple-scroll` in the future that will support `react-router 4` and beyond.
49+
4650
## Quick Start
4751

4852
To install `react-simple-scroll`, add it as a middleware to `<Router />`:

package.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-simple-scroll",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "Declarative API for SPA scroll position",
55
"main": "build/SimpleScroll.js",
66
"scripts": {
@@ -27,16 +27,17 @@
2727
},
2828
"homepage": "https://github.com/button/react-simple-scroll#readme",
2929
"peerDependencies": {
30-
"react": "^0.14.0 || ^15.0.0",
31-
"react-router": "^2.4.0 || ^3.0.0"
30+
"react": "^16.0.0",
31+
"react-router": "^3.2.0"
3232
},
3333
"devDependencies": {
3434
"babel-cli": "^6.18.0",
3535
"babel-core": "^6.21.0",
3636
"babel-eslint": "^7.1.1",
3737
"babel-preset-es2015": "^6.18.0",
3838
"babel-preset-react": "^6.16.0",
39-
"enzyme": "^2.7.0",
39+
"enzyme": "^3.10.0",
40+
"enzyme-adapter-react-16": "^1.15.1",
4041
"eslint": "^3.13.1",
4142
"eslint-config-airbnb": "^13.0.0",
4243
"eslint-config-button": "1.0.4",
@@ -47,11 +48,11 @@
4748
"jsdom": "^9.9.1",
4849
"lodash.isequal": "^4.5.0",
4950
"mocha": "^3.2.0",
50-
"react": "^0.14.0",
51-
"react-addons-test-utils": "0.14.0",
52-
"react-dom": "^0.14.0",
51+
"prop-types": "^15.7.2",
52+
"react": "^16.11.0",
53+
"react-dom": "^16.11.0",
5354
"rimraf": "^2.5.4",
54-
"sinon": "^1.17.7"
55+
"sinon": "7.5.0"
5556
},
5657
"files": [
5758
"LICENSE",

src/SimpleScroll.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// eslint-disable-next-line import/no-unresolved
2-
import React, { PropTypes, Component } from 'react';
2+
import React, { Component } from 'react';
3+
import PropTypes from 'prop-types';
34

45
class SimpleScroll extends Component {
56

test/setup.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import { jsdom } from 'jsdom';
2+
import Enzyme from 'enzyme';
3+
import Adapter from 'enzyme-adapter-react-16';
4+
5+
Enzyme.configure({ adapter: new Adapter() });
26

37
const markup = '<html><body></body></html>';
48

0 commit comments

Comments
 (0)