-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: TextInput now acts as a host component and can be passed directly to our new APIs that require a host component. Callsites no longer need to call ``` inputRef.getNativeRef() ``` We mutate the ref to the host component adding the imperative methods of the TextInput so you can still call `inputRef.clear` and `inputRef.isFocused`. Changelog: [General][Changed] TextInput now uses `forwardRef` allowing it to be used directly by new APIs requiring a host component. Reviewed By: yungsters Differential Revision: D18458408 fbshipit-source-id: 1f149fd575210d702fa0fdf3d05bb2162436a773
- Loading branch information
1 parent
99dc4e2
commit bbc5c35
Showing
4 changed files
with
135 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bbc5c35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, it was I'm looking for and I did similar in a project that I'm working...
bbc5c35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a React.forwardRef(...) around functional component containing a TextInput, and passing it the ref.
Before From outside I would retrieve the value like so...
userIDRef.current?.props.value || ''
Since this update, props is undefined.
How do I now access the TextInput properties please?
I feel like this an easy fix, but a lot of my forms are broken with this update.
Thanks