on focused text input style react native

Solutions on MaxInterview for on focused text input style react native by the best coders in the world

showing results for - "on focused text input style react native"
Jazmín
13 Mar 2017
1You can achieve this by passing in the onFocus and onBlur events to set and unset styles when focused and blurred:
2
3  onFocus() {
4    this.setState({
5        backgroundColor: 'green'
6    })
7  },
8
9  onBlur() {
10    this.setState({
11      backgroundColor: '#ededed'
12    })
13  },
14And then, in the TextInput do this:
15
16<TextInput 
17    onBlur={ () => this.onBlur() }
18    onFocus={ () => this.onFocus() }
19    style={{ height:60, backgroundColor: this.state.backgroundColor, color: this.state.color }}  />
Nico
09 Sep 2019
1<TextInput theme={{ colors: { primary: "color of your wish" } }} />
2
similar questions
queries leading to this page
on focused text input style react native