chymtt / ReactNativeDropdownAndroid

A simple wrapper for Android's Spinner in react-native
MIT License
62 stars 22 forks source link

onChange not being called when selected prop change via setState #7

Closed diedu89 closed 8 years ago

diedu89 commented 8 years ago
render() {
    return (
      <Dropdown
        style={{ height: 20, width: 200}}
        values={[ '--Choose--', 'one', 2, 3.5, { four: 4 }, [ 5, 6, 7 ], false ]} 
        selected={this.state.selected} onChange={(data) => { console.log(data); }} />
    );
  }

somewhere else in the code

this.setState({selected: 3})
diedu89 commented 8 years ago

My bad, it does call onChange with the example above, seems that it is a specific case where it is not working for some reason, I will check what could be wrong and upload an example of that case.