nulrich / RCTAutoComplete

React Native Component for MLPAutoCompleteTextField
MIT License
171 stars 26 forks source link

undefined is not an object (evaluating '_this.refs.input.setNativeProps') #26

Closed hnguyen14 closed 8 years ago

hnguyen14 commented 8 years ago

this error is triggered when the input field already has value and I'm trying to modify it.

The errors from from this code block (RCTAutoComplete.ios.js)

if (text !== this.props.value && typeof this.props.value === 'string') {
  this.refs.input.setNativeProps({
    text: this.props.value,
  });
}

but there doesn't seem to be a ref="input" anywhere in the component. Am I missing something ?

hnguyen14 commented 8 years ago

Hi ... this bug has been fixed with https://github.com/nulrich/RCTAutoComplete/pull/31 ... Can you publish this change to NPM ? I think this is a critical bug that prevent user to re-enter value for the input field (throws the error mentioned in the title).

nulrich commented 8 years ago

I'm fixing #29 and I will do the christmas release

nulrich commented 8 years ago

Fixed by #31 thanks