This commit is contained in:
John Lyon-Smith
2018-05-14 21:41:33 -07:00
parent 5d67cb69b0
commit 609bb1c3d5
6 changed files with 22 additions and 92 deletions

View File

@@ -24,6 +24,7 @@ export class BoundInput extends React.Component {
const { name, binder } = this.props
this.state = binder.getFieldState(name)
this.handleChangeText = this.handleChangeText.bind(this)
}
componentWillReceiveProps(nextProps) {
@@ -32,12 +33,12 @@ export class BoundInput extends React.Component {
}
}
@autobind
// @autobind : There seems to be a bug with using this here, so we just do it the old way
handleChangeText(newText) {
if (this && this.props && this.props.binder) {
this.setState(
this.props.binder.updateFieldValue(this.props.name, newText)
)
const { binder, name } = this.props
if (binder) {
this.setState(binder.updateFieldValue(name, newText))
}
}