chore: add warning when using InputAccessoryView#24
chore: add warning when using InputAccessoryView#24okwasniewski merged 6 commits intocallstack:mainfrom TMisiukiewicz:input-accessory-view-warning
InputAccessoryView#24Conversation
| // once the 'visionos' is implemented as a platform, we can remove this | ||
| componentDidMount() { | ||
| if (Platform.isVisionOS) { | ||
| console.warn('InputAccessoryView is not available on VisionOS platform.'); |
There was a problem hiding this comment.
Can you change the name to 'visionOS'? As it's the official naming Apple uses
matthargett
left a comment
There was a problem hiding this comment.
minor changes requested
packages/react-native/Libraries/Components/TextInput/InputAccessoryView.js
Outdated
Show resolved
Hide resolved
packages/react-native/Libraries/Components/TextInput/InputAccessoryView.js
Outdated
Show resolved
Hide resolved
|
@matthargett thanks for your comments, everything is fixed now. Also rebased branch with the current main |
| componentDidMount() { | ||
| if (Platform.isVisionOS) { | ||
| warnOnce( | ||
| 'component-unavailable', |
There was a problem hiding this comment.
@TMisiukiewicz @okwasniewski Shouldn't the key here be something more identifiable, like InputAccessoryView-unavailable?
component-unavailable seems a bit generic, and if it is used in other files, I believe one warning might override the other, causing some to be missed?
There was a problem hiding this comment.
That's valid point I think we should rename it
There was a problem hiding this comment.
no problem, i'll take care of it in a new PR
Summary:
Closing #8
Since
InputAccessoryViewis not supported on VisionOS, this change adds a warning message about the component being unavailable on the platform.Changelog:
[VISIONOS] [ADDED] - warning about unavailable
InputAccessoryViewTest Plan:
InputAccessoryViewin RNTester