File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ export default class TextField extends Component {
23
23
focus ( ) {
24
24
this . refs . input . focus ( ) ;
25
25
}
26
+ componentWillReceiveProps ( props ) {
27
+ this . setState ( { text : props . value } )
28
+ }
26
29
render ( ) {
27
30
let {
28
31
label,
@@ -34,13 +37,14 @@ export default class TextField extends Component {
34
37
onBlur,
35
38
onChangeText,
36
39
value,
40
+ style,
37
41
dense,
38
42
...props
39
43
} = this . props ;
40
44
return (
41
45
< View style = { dense ? styles . denseWrapper : styles . wrapper } ref = "wrapper" >
42
46
< TextInput
43
- style = { dense ? styles . denseTextInput : styles . textInput }
47
+ style = { [ dense ? styles . denseTextInput : styles . textInput , style ] }
44
48
onFocus = { ( ) => {
45
49
this . setState ( { isFocused : true } ) ;
46
50
this . refs . floatingLabel . floatLabel ( ) ;
@@ -87,6 +91,7 @@ TextField.propTypes = {
87
91
duration : PropTypes . number ,
88
92
label : PropTypes . string ,
89
93
highlightColor : PropTypes . string ,
94
+ style : PropTypes . any ,
90
95
onFocus : PropTypes . func ,
91
96
onBlur : PropTypes . func ,
92
97
onChangeText : PropTypes . func ,
You can’t perform that action at this time.
0 commit comments