Skip to content

Commit f3ddcf5

Browse files
committed
Merge branch 'pr/11'
2 parents 4f55a2f + ae21ecd commit f3ddcf5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

demo/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257
}, {
258258
key: 'componentWillReceiveProps',
259259
value: function componentWillReceiveProps(nextProps) {
260-
if (nextProps.text !== this.state.text) {
260+
if (nextProps.text !== this.props.text) {
261261
this.setState({ text: nextProps.text });
262262
}
263263
}

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var InlineEdit = function (_React$Component) {
8787
}, {
8888
key: 'componentWillReceiveProps',
8989
value: function componentWillReceiveProps(nextProps) {
90-
if (nextProps.text !== this.state.text) {
90+
if (nextProps.text !== this.props.text) {
9191
this.setState({ text: nextProps.text });
9292
}
9393
}

index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export default class InlineEdit extends React.Component {
4646
}
4747

4848
componentWillReceiveProps(nextProps) {
49-
if (nextProps.text !== this.state.text) {
49+
if (nextProps.text !== this.props.text) {
5050
this.setState({ text: nextProps.text });
5151
}
5252
}

0 commit comments

Comments
 (0)