-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs] Add setNativeProps documentation (Original title: clear() function on TextInput) #1390
Comments
@dvine-multimedia - are you using |
@brentvatne I didn't realize that |
@dvine-multimedia - good point, documentation for |
Haven't seen any notes about |
@grabbou yes, would be good to document public methods like |
@grabbou - any interest in adding some documentation for |
Yeah, can add in some descriptions, any hints what's the appropriate place for them speaking docs structure wise? |
@grabbou - TextInput seems like the best spot |
@grabbou - I'm going to close this issue, can you open a PR for that when it's ready? Thanks 😄 |
Docs that cover setNativeProps for TextInput clearing are here: https://facebook.github.io/react-native/docs/direct-manipulation.html#setnativeprops-to-clear-textinput-value |
Ah, nice! Will send over later today. |
The problem: I need to clear a TextInput after some user interaction.
The request: expose some kind of clear() or even setText() functionality.
I understand that this is exactly the mutative approach to UI programming, that React is trying to get rid of. But as the docs state them selfs, a controlled approach to the TextInput component using the value property doesn't perform.
My current solution is to set the value property to null once on the next render after the user interaction. But this feels rather clunky. Since the declarative approach seems to break down with the TextInput implementation I would argue for exposing the mutative API.
The text was updated successfully, but these errors were encountered: