Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import StyleSheet, {
type ViewStyleProp,
} from '../../StyleSheet/StyleSheet';
import Platform from '../../Utilities/Platform';
import warnOnce from '../../Utilities/warnOnce';
import RCTInputAccessoryViewNativeComponent from './RCTInputAccessoryViewNativeComponent';
import * as React from 'react';

Expand Down Expand Up @@ -86,7 +87,22 @@ type Props = $ReadOnly<{|
|}>;

class InputAccessoryView extends React.Component<Props> {
// TODO: once the 'visionos' is implemented as a platform, we can remove this
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

'InputAccessoryView is not available on visionOS platform.',
);
}
}

render(): React.Node {
// TODO: once the 'visionos' is implemented as a platform, we can remove this
if (Platform.isVisionOS) {
return null;
}

if (Platform.OS === 'ios') {
if (React.Children.count(this.props.children) === 0) {
return null;
Expand Down