Join to get personalized course recommendations for you.

React Native Discussion Forums

There's no such thing as a stupid question. Ask. Discuss. Learn.

How do we change text input's value in react native

I would like to change the text input's value without using setstate.
Please How can I do

Zaki Tutu 5 months ago
  • Karthikeyan-vk

    If you do not want to use setState means you do not want your component to render. But how do you expect to see a visible change of the value in the text input without re rendering of the component. React re renders the parts of the component and not the entire component. So I think you don't have to worry about re rendering of the component. If you still don't want to use setState, you can change the date in the text input using this.state.somepropertyname and use this.forceUpdate() when you are done with the changes and want your component to re render. But have to warn you that using forceUpdate is discouraged and use only when it is absolutely required.

  • Whitelisted Links