react-timeout
Advanced tools
Comparing version 1.2.0 to 2.0.0
{ | ||
"name": "react-timeout", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"description": "HOC for React and React Native providing versions of setTimeout etc. that cancels when unmounted.", | ||
@@ -23,15 +23,21 @@ "homepage": "https://github.com/plougsgaard/react-timeout", | ||
}, | ||
"main": "src/web.js", | ||
"main": "src/index.js", | ||
"standard": { | ||
"parser": "babel-eslint" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-push": "npm run standard && npm run check-es5 && npm test" | ||
} | ||
}, | ||
"scripts": { | ||
"test": "mocha --compilers js:babel-core/register --require ./test/helper.js 'test/**/*.@(js|jsx)'" | ||
"check-es5": "jshint src/*.js", | ||
"test": "jest", | ||
"standard": "standard" | ||
}, | ||
"files": [ | ||
"src/web.js", | ||
"src/native.js", | ||
"src/reactTimeout.js", | ||
"native.js", | ||
"src/index.js", | ||
"README.md" | ||
], | ||
"dependencies": { | ||
"create-react-class": "^15.5.2", | ||
"hoist-non-react-statics": "^2.3.1", | ||
@@ -41,15 +47,18 @@ "object-assign": "^4.0.1" | ||
"devDependencies": { | ||
"babel-cli": "6.2.0", | ||
"babel-core": "6.2.0", | ||
"babel-preset-es2015": "6.1.18", | ||
"babel-preset-react": "6.1.18", | ||
"babel-preset-stage-1": "6.1.18", | ||
"chai": "4.0.0", | ||
"chai-immutable": "1.5.3", | ||
"immutable": "3.8.0", | ||
"jsdom": "11.11.0", | ||
"mocha": "5.0.0", | ||
"react": "16.8.1", | ||
"react-dom": "16.8.1" | ||
"@babel/plugin-proposal-class-properties": "7.7.4", | ||
"@babel/preset-env": "7.7.7", | ||
"@babel/preset-react": "7.7.4", | ||
"babel-eslint": "10.0.3", | ||
"babel-jest": "24.1.0", | ||
"babel-polyfill": "6.26.0", | ||
"husky": "3.1.0", | ||
"jest": "24.1.0", | ||
"jest-dom": "3.5.0", | ||
"jshint": "2.10.3", | ||
"react": "16.13.0", | ||
"react-dom": "16.13.0", | ||
"react-test-renderer": "16.13.0", | ||
"react-testing-library": "6.0.4", | ||
"standard": "14.3.1" | ||
} | ||
} |
@@ -24,4 +24,15 @@ # React Timeout | ||
`npm install --save react-timeout` | ||
``` | ||
npm install --save react-timeout | ||
``` | ||
## Version Compatibility | ||
| React | React Timeout | | ||
| :------- | :------------: | | ||
| `16.3`+ | `2+` | | ||
| <`16.3` | `1.x` | | ||
# Usage | ||
## React / React Native | ||
@@ -80,3 +91,3 @@ | ||
## With ES7 Annotations | ||
## With Annotations | ||
@@ -95,5 +106,8 @@ ```javascript | ||
## To access the wrapped instance | ||
If you need access to the component wrapped by `ReactTimeout`, use `component.getWrappedInstance()`. | ||
## Accessing the wrapped instance | ||
You can access the wrapped instance using `React.createRef` from version `2+`. | ||
If you're using version `1.x` you can access the wrapped instance with `component.getWrappedInstance()`. | ||
# Something similar | ||
@@ -105,6 +119,6 @@ | ||
# Caveats | ||
## React Native 0.17 and below | ||
Only supported by version `1.x`. | ||
If you're using a version of React Native that is `0.17` or below you have to import from the `/native` namespace. | ||
@@ -111,0 +125,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
125
8683
15
3
82
1
- Removedcreate-react-class@^15.5.2
- Removedcreate-react-class@15.7.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)