Skip to content

Commit fec3eff

Browse files
committed
Merge pull request Hacker0x01#451 from Hacker0x01/allow-react-15
Allow react 15
2 parents fb3b6bd + 4e38120 commit fec3eff

File tree

4 files changed

+9
-21
lines changed

4 files changed

+9
-21
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
"transform": "react-transform-hmr",
99
"imports": ["react"],
1010
"locals": ["module"]
11-
}, {
12-
"transform": "react-transform-catch-errors",
13-
"imports": ["react", "redbox-react"]
1411
}]
1512
}]
1613
]

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ addons:
1212
- g++-4.8
1313
rvm:
1414
- 2.1.7
15-
cache:
16-
directories:
17-
- node_modules
18-
- vendor/bundle
1915
before_install:
2016
- npm install -g grunt-cli
2117
- gem update --system && gem install scss_lint -v 0.44.0

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,9 @@
6666
"lodash": "^4.3.0",
6767
"mocha": "^2.2.5",
6868
"node-sass": "^3.4.2",
69-
"react-addons-test-utils": "^0.14.0",
69+
"react-addons-test-utils": "^15.0.0",
7070
"react-docgen": "^2.7.0",
71-
"react-dom": "^0.14.0",
72-
"react-transform-catch-errors": "^1.0.0",
7371
"react-transform-hmr": "^1.0.1",
74-
"redbox-react": "^1.2.0",
7572
"sass-loader": "^3.1.2",
7673
"sinon": "^1.15.4",
7774
"style-loader": "^0.13.0",
@@ -81,8 +78,8 @@
8178
"webpack-hot-middleware": "^2.6.0"
8279
},
8380
"peerDependencies": {
84-
"react": "^0.14.0",
85-
"react-dom": "^0.14.0"
81+
"react": "^0.14.0 || ^15.0.0",
82+
"react-dom": "^0.14.0 || ^15.0.0"
8683
},
8784
"dependencies": {
8885
"classnames": "^2.2.1",

src/date_input.jsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var DateInput = React.createClass({
2828

2929
getInitialState () {
3030
return {
31-
maybeDate: this.safeDateFormat(this.props)
31+
value: this.safeDateFormat(this.props)
3232
}
3333
},
3434

@@ -37,7 +37,7 @@ var DateInput = React.createClass({
3737
newProps.locale !== this.props.locale ||
3838
newProps.dateFormat !== this.props.dateFormat) {
3939
this.setState({
40-
maybeDate: this.safeDateFormat(newProps)
40+
value: this.safeDateFormat(newProps)
4141
})
4242
}
4343
},
@@ -60,20 +60,18 @@ var DateInput = React.createClass({
6060
this.props.onChangeDate(null)
6161
}
6262
}
63-
this.setState({
64-
maybeDate: value
65-
})
63+
this.setState({value})
6664
},
6765

6866
safeDateFormat (props) {
6967
return props.date && props.date.clone()
7068
.locale(props.locale || moment.locale())
71-
.format(props.dateFormat)
69+
.format(props.dateFormat) || ''
7270
},
7371

7472
handleBlur (event) {
7573
this.setState({
76-
maybeDate: this.safeDateFormat(this.props)
74+
value: this.safeDateFormat(this.props)
7775
})
7876
if (this.props.onBlur) {
7977
this.props.onBlur(event)
@@ -89,7 +87,7 @@ var DateInput = React.createClass({
8987
ref='input'
9088
type='text'
9189
{...this.props}
92-
value={this.state.maybeDate}
90+
value={this.state.value}
9391
onBlur={this.handleBlur}
9492
onChange={this.handleChange} />
9593
}

0 commit comments

Comments
 (0)