Fix warning in InputAccessoryView (#21174)

Summary:
Currently the warning is always triggered, even on iOS. This simply adds a platform check and tweak the message.
Pull Request resolved: https://github.com/facebook/react-native/pull/21174

Differential Revision: D9929679

Pulled By: hramos

fbshipit-source-id: 383f4a820cf5bf261dbfdcff3b950f9812a65e00
This commit is contained in:
Janic Duplessis 2018-09-18 18:16:42 -07:00 committed by Facebook Github Bot
parent fd3bb5769d
commit a0f7d6090f

View File

@ -11,6 +11,7 @@
const ColorPropType = require('ColorPropType');
const DeprecatedViewPropTypes = require('DeprecatedViewPropTypes');
const Platform = require('Platform');
const React = require('React');
const StyleSheet = require('StyleSheet');
@ -89,7 +90,9 @@ type Props = {
class InputAccessoryView extends React.Component<Props> {
render(): React.Node {
console.warn('<InputAccessoryView> is not supported on Android yet.');
if (Platform.OS !== 'ios') {
console.warn('<InputAccessoryView> is only supported on iOS.');
}
if (React.Children.count(this.props.children) === 0) {
return null;