halilb / react-native-textinput-effects

Text inputs with custom label and icon animations for iOS and android. Built with react native and inspired by Codrops.
MIT License
2.98k stars 291 forks source link

onChangeText #97

Closed CuongTran69 closed 5 years ago

CuongTran69 commented 5 years ago

How I can use event onChangeText() :(

edgesinghkataria commented 5 years ago

There is a property on change you can see the below code for reference

this.state={
ac_password : null
}
  <Fumi
  style={{width:'100%'}}
    label={'Password'}
    iconClass={FontAwesomeIcon}
    iconName={'lock'}
    iconColor={'#FF456D'}
    iconSize={20}
    iconWidth={40}
    inputPadding={16}
    onChangeText={(ac_password) => { this.setState({ac_password}) }} // here updating state on very chnage
/>
halilb commented 5 years ago

You can directly use react-native TextInput props @CuongTran69, just like @simransinghkataria has posted.

You can read more about it in react-native documentation: https://twitter.com/davidwalshblog/status/1109993816365428736