Answers for "react native elements input highlight onfous"

2

react native elements input highlight onfous

You can achieve this by passing in the onFocus and onBlur events to set and unset styles when focused and blurred:

  onFocus() {
    this.setState({
        backgroundColor: 'green'
    })
  },

  onBlur() {
    this.setState({
      backgroundColor: '#ededed'
    })
  },
And then, in the TextInput do this:

<TextInput 
    onBlur={ () => this.onBlur() }
    onFocus={ () => this.onFocus() }
    style={{ height:60, backgroundColor: this.state.backgroundColor, color: this.state.color }}  />
Posted by: Guest on October-19-2020

Code answers related to "react native elements input highlight onfous"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language