Skip to content

[Docs] Add setNativeProps documentation (Original title: clear() function on TextInput) #1390

@d-vine

Description

@d-vine

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.

Metadata

Metadata

Assignees

Labels

Good first issueInterested in collaborating? Take a stab at fixing one of these issues.Resolution: LockedThis issue was locked by the bot.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions