Skip to content

Commit 84a74d9

Browse files
committed
Use prop-types package instead of accessing PropTypes via main React package (deprecated)
1 parent 133b74a commit 84a74d9

File tree

3 files changed

+27
-25
lines changed

3 files changed

+27
-25
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ React component which wrap web-notification.
2323

2424
```javascript
2525
Notification.propTypes = {
26-
ignore: React.PropTypes.bool,
27-
disableActiveWindow: React.PropTypes.bool,
28-
notSupported: React.PropTypes.func,
29-
onPermissionGranted: React.PropTypes.func,
30-
onPermissionDenied: React.PropTypes.func,
31-
onShow: React.PropTypes.func,
32-
onClick: React.PropTypes.func,
33-
onClose: React.PropTypes.func,
34-
onError: React.PropTypes.func,
35-
timeout: React.PropTypes.number,
36-
title: React.PropTypes.string.isRequired,
37-
options: React.PropTypes.object
26+
ignore: bool,
27+
disableActiveWindow: bool,
28+
notSupported: func,
29+
onPermissionGranted: func,
30+
onPermissionDenied: func,
31+
onShow: func,
32+
onClick: func,
33+
onClose: func,
34+
onError: func,
35+
timeout: number,
36+
title: string.isRequired,
37+
options: object
3838
};
3939

4040
```

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"karma-safari-launcher": "^0.1.1",
5151
"karma-spec-reporter": "0.0.23",
5252
"mocha": "^2.3.4",
53+
"prop-types": "^15.5.8",
5354
"react-addons-test-utils": "^0.14.3 || ^15.0.1",
5455
"react-dom": "^0.14.3 || ^15.0.1",
5556
"rimraf": "^2.4.4",

src/components/Notification.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
import React from 'react';
4+
import { bool, func, number, object, string } from 'prop-types';
45

56
const PERMISSION_GRANTED = 'granted';
67
const PERMISSION_DENIED = 'denied';
@@ -147,19 +148,19 @@ class Notification extends React.Component {
147148
}
148149

149150
Notification.propTypes = {
150-
ignore: React.PropTypes.bool,
151-
disableActiveWindow: React.PropTypes.bool,
152-
askAgain: React.PropTypes.bool,
153-
notSupported: React.PropTypes.func,
154-
onPermissionGranted: React.PropTypes.func,
155-
onPermissionDenied: React.PropTypes.func,
156-
onShow: React.PropTypes.func,
157-
onClick: React.PropTypes.func,
158-
onClose: React.PropTypes.func,
159-
onError: React.PropTypes.func,
160-
timeout: React.PropTypes.number,
161-
title: React.PropTypes.string.isRequired,
162-
options: React.PropTypes.object
151+
ignore: bool,
152+
disableActiveWindow: bool,
153+
askAgain: bool,
154+
notSupported: func,
155+
onPermissionGranted: func,
156+
onPermissionDenied: func,
157+
onShow: func,
158+
onClick: func,
159+
onClose: func,
160+
onError: func,
161+
timeout: number,
162+
title: string.isRequired,
163+
options: object
163164
};
164165

165166
Notification.defaultProps = {

0 commit comments

Comments
 (0)