Skip to content

Commit 847f843

Browse files
committed
Merge branch 'andrewBalekha-improvement/prepare-for-react-15.5' into develop
2 parents d0e85e2 + a3f8e09 commit 847f843

7 files changed

Lines changed: 37 additions & 25 deletions

File tree

example/src/scripts/App.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var React = require('react');
22
var ReactDOM = require('react-dom');
3+
var createReactClass = require('create-react-class');
34
var NotificationSystem = require('NotificationSystem');
45
var constants = require('constants');
56
var NotificationGenerator = require('./NotificationGenerator');
@@ -14,7 +15,7 @@ var _getRandomPosition = function() {
1415
// Styles
1516
require('styles/base');
1617

17-
NotificationSystemExample = React.createClass({
18+
NotificationSystemExample = createReactClass({
1819

1920
displayName: 'App',
2021

example/src/scripts/CustomElement.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var React = require('react');
2+
var PropTypes = require('prop-types');
23

34
function buttonClicked() {
45
alert('I\'m a custom button inside a custom element that was clicked');
@@ -14,7 +15,7 @@ function CustomElement(props) {
1415
}
1516

1617
CustomElement.propTypes = {
17-
name: React.PropTypes.string
18+
name: PropTypes.string
1819
};
1920

2021
module.exports = CustomElement;

example/src/scripts/NotificationGenerator.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
var React = require('react');
2+
var createReactClass = require('create-react-class');
3+
var PropTypes = require('prop-types');
24

35
// Styles
46
require('styles/generator');
57

6-
module.exports = React.createClass({
8+
module.exports = createReactClass({
79

810
displayName: 'NotificationGenerator',
911

@@ -134,8 +136,8 @@ module.exports = React.createClass({
134136
},
135137

136138
propTypes: {
137-
notifications: React.PropTypes.func.isRequired,
138-
allowHTML: React.PropTypes.func
139+
notifications: PropTypes.func.isRequired,
140+
allowHTML: PropTypes.func
139141
},
140142

141143
render: function() {

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
},
3333
"homepage": "https://github.com/igorprado/react-notification-system",
3434
"dependencies": {
35-
"object-assign": "^4.0.1"
35+
"create-react-class": "^15.5.1",
36+
"object-assign": "^4.0.1",
37+
"prop-types": "^15.5.6"
3638
},
3739
"peerDependencies": {
3840
"react": "0.14.x || ^15.0.0",

src/NotificationContainer.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
var React = require('react');
2+
var createReactClass = require('create-react-class');
3+
var PropTypes = require('prop-types');
24
var NotificationItem = require('./NotificationItem');
35
var Constants = require('./constants');
46

5-
var NotificationContainer = React.createClass({
7+
var NotificationContainer = createReactClass({
68

79
propTypes: {
8-
position: React.PropTypes.string.isRequired,
9-
notifications: React.PropTypes.array.isRequired,
10-
getStyles: React.PropTypes.object
10+
position: PropTypes.string.isRequired,
11+
notifications: PropTypes.array.isRequired,
12+
getStyles: PropTypes.object
1113
},
1214

1315
_style: {},

src/NotificationItem.jsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
var React = require('react');
2+
var createReactClass = require('create-react-class');
3+
var PropTypes = require('prop-types');
24
var ReactDOM = require('react-dom');
35
var Constants = require('./constants');
46
var Helpers = require('./helpers');
@@ -24,17 +26,17 @@ var whichTransitionEvent = function() {
2426
return transition;
2527
};
2628

27-
var NotificationItem = React.createClass({
29+
var NotificationItem = createReactClass({
2830

2931
propTypes: {
30-
notification: React.PropTypes.object,
31-
getStyles: React.PropTypes.object,
32-
onRemove: React.PropTypes.func,
33-
allowHTML: React.PropTypes.bool,
34-
noAnimation: React.PropTypes.bool,
35-
children: React.PropTypes.oneOfType([
36-
React.PropTypes.string,
37-
React.PropTypes.element
32+
notification: PropTypes.object,
33+
getStyles: PropTypes.object,
34+
onRemove: PropTypes.func,
35+
allowHTML: PropTypes.bool,
36+
noAnimation: PropTypes.bool,
37+
children: PropTypes.oneOfType([
38+
PropTypes.string,
39+
PropTypes.element
3840
])
3941
},
4042

src/NotificationSystem.jsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
var React = require('react');
2+
var createReactClass = require('create-react-class');
3+
var PropTypes = require('prop-types');
24
var merge = require('object-assign');
35
var NotificationContainer = require('./NotificationContainer');
46
var Constants = require('./constants');
57
var Styles = require('./styles');
68

7-
var NotificationSystem = React.createClass({
9+
var NotificationSystem = createReactClass({
810

911
uid: 3400,
1012

@@ -86,12 +88,12 @@ var NotificationSystem = React.createClass({
8688
},
8789

8890
propTypes: {
89-
style: React.PropTypes.oneOfType([
90-
React.PropTypes.bool,
91-
React.PropTypes.object
91+
style: PropTypes.oneOfType([
92+
PropTypes.bool,
93+
PropTypes.object
9294
]),
93-
noAnimation: React.PropTypes.bool,
94-
allowHTML: React.PropTypes.bool
95+
noAnimation: PropTypes.bool,
96+
allowHTML: PropTypes.bool
9597
},
9698

9799
getDefaultProps: function() {

0 commit comments

Comments
 (0)