Mark hasTVPreferredFocus as deprecated#52043
Mark hasTVPreferredFocus as deprecated#52043Abbondanzo wants to merge 1 commit intofacebook:mainfrom
Conversation
Summary: The `hasTVPreferredFocus` prop is functionally similar to the `focusable` prop. On iOS, the props are identical. The primary difference appears on Android, where the prop attempts to request focus when set to true. Attempting to invoke imperative API calls through declarative means has been [a source of confusion](react-native-tvos/react-native-tvos#237) and we should instead recommend requesting focus through imperative means, like calling `focus()` on a specific view's ref instead. Workarounds presented rely on lifecycle methods to request focus natively. This change only marks these methods as deprecated on JS. In the following version, they will be removed from the public API. Changelog: [General][Deprecated] - Deprecate `hasTVPreferredFocus` Differential Revision: D76732539
|
This pull request was exported from Phabricator. Differential Revision: D76732539 |
|
This pull request has been merged in cfb6c96. |
|
This pull request was successfully merged by @Abbondanzo in cfb6c96 When will my fix make it into a release? | How to file a pick request? |
This commit is empty for React Native TV. Summary: Pull Request resolved: facebook/react-native#52043 The `hasTVPreferredFocus` prop is functionally similar to the `focusable` prop. On iOS, the props are identical. The primary difference appears on Android, where the prop attempts to request focus when set to true. Attempting to invoke imperative API calls through declarative means has been [a source of confusion](#237) and we should instead recommend requesting focus through imperative means, like calling `focus()` on a specific view's ref instead. Workarounds presented rely on lifecycle methods to request focus natively. This change only marks these methods as deprecated on JS. In the following version, they will be removed from the public API. Changelog: [General][Deprecated] - Deprecate `hasTVPreferredFocus` Reviewed By: andrewdacenko Differential Revision: D76732539 fbshipit-source-id: 64912b4dacb76cd40e79148c1082d8ed8f573879
|
@Abbondanzo @cipolleschi just a heads up from the React Native TV repo -- this change caused a slight regression in the TV repo when it was merged from upstream, as this API is used there. For the record, If possible, it would be great to add me to the review for any future PRs like this that affect TV APIs 😄 Thanks very much, and I apologize for not catching this sooner! |
Summary:
The
hasTVPreferredFocusprop is functionally similar to thefocusableprop. On iOS, the props are identical. The primary difference appears on Android, where the prop attempts to request focus when set to true. Attempting to invoke imperative API calls through declarative means has been a source of confusion and we should instead recommend requesting focus through imperative means, like callingfocus()on a specific view's ref instead. Workarounds presented rely on lifecycle methods to request focus natively.This change only marks these methods as deprecated on JS. In the following version, they will be removed from the public API.
Changelog: [General][Deprecated] - Deprecate
hasTVPreferredFocusDifferential Revision: D76732539