-
Notifications
You must be signed in to change notification settings - Fork 32
chore: add warning when using InputAccessoryView
#24
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
chore: add warning when using InputAccessoryView
#24
Conversation
| // 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the name to 'visionOS'? As it's the official naming Apple uses
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.
done ✅
matthargett
left a comment
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's valid point I think we should rename it
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.
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