Skip to content

Conversation

@TMisiukiewicz
Copy link

@TMisiukiewicz TMisiukiewicz commented Oct 27, 2023

Summary:

Closing #8
Since InputAccessoryView is not supported on VisionOS, this change adds a warning message about the component being unavailable on the platform.

Changelog:

[VISIONOS] [ADDED] - warning about unavailable InputAccessoryView

Test Plan:

  1. Open InputAccessoryView in RNTester
  2. Verify warn is displayed in the app and in the Metro logs
image Screenshot 2023-10-28 at 11 38 48

// 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.');
Copy link
Member

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done ✅

Copy link
Collaborator

@matthargett matthargett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor changes requested

@TMisiukiewicz
Copy link
Author

@matthargett thanks for your comments, everything is fixed now. Also rebased branch with the current main

componentDidMount() {
if (Platform.isVisionOS) {
warnOnce(
'component-unavailable',

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?

Copy link
Member

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

Copy link
Author

@TMisiukiewicz TMisiukiewicz Nov 6, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants