From 55861879efdfbe970bb7c74bd7003dddf0514db0 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Tue, 18 Sep 2018 18:16:42 -0700 Subject: [PATCH] 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 --- Libraries/Components/TextInput/InputAccessoryView.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Libraries/Components/TextInput/InputAccessoryView.js b/Libraries/Components/TextInput/InputAccessoryView.js index 05f6ccb980e144..c77269dbe307ac 100644 --- a/Libraries/Components/TextInput/InputAccessoryView.js +++ b/Libraries/Components/TextInput/InputAccessoryView.js @@ -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 { render(): React.Node { - console.warn(' is not supported on Android yet.'); + if (Platform.OS !== 'ios') { + console.warn(' is only supported on iOS.'); + } if (React.Children.count(this.props.children) === 0) { return null;