eyaleizenberg / react-native-floating-label-text-input

A React Native component for floating label text input
MIT License
285 stars 83 forks source link

text not changed after calling function #13

Open gerard0315 opened 8 years ago

gerard0315 commented 8 years ago

Hi, tried the package, looks awesome, but the input text is not changed after modifications

eyaleizenberg commented 8 years ago

Hi, Can you please give more information? steps to recreate? Version? etc..

gerard0315 commented 8 years ago

I am using RN 0.24.1, this is my component <FloatLabelTextInput selectionColor = "#D25061" placeholder={"Name Here"} value={this.state.Name} onChangeTextValue={this.onNameInput} />

this is onNameInput function:

    onNameInput: function(event) {
        console.log('editing Name');
        this.setState({ Name: event.nativeEvent.text });
        console.log(this.state.Name);
},

tried to change onChangeText={this.setText} to onChange = {this.setText}, it actually worked but gave a type warning

eyaleizenberg commented 8 years ago

But it looks like you are setting the state to dogName and not Name

gerard0315 commented 8 years ago

yeah sorry thats a typo in the post but not in the actual code, fixed that.

eyaleizenberg commented 8 years ago

Is this still an issue?