I don't know whether it's a bug on react native TextInput or if I am doing something wrong. When I try to show initial value based on state as default value on TextInput it works only for string and not for number.
this.state = {referralCode: 10}
<TextInput value={this.state.referralCode} />
This due to some reason does not works and shows empty but it should read the intezer value from the state. As soon as I update the state with some string as initial value the TextInput shows it on initial render.
this.state = {referralCode: 'Rishav'};
<TextInput value={this.state.referralCode}
/>
It happens to render the initial state value now because it is in string.
Also,
<TextInput value={10}/> fails but <TextInput value={'10'}/> works