Skip to content

Commit

Permalink
Fix warning in InputAccessoryView (facebook#21174)
Browse files Browse the repository at this point in the history
Summary:
Currently the warning is always triggered, even on iOS. This simply adds a platform check and tweak the message.
Pull Request resolved: facebook#21174

Differential Revision: D9929679

Pulled By: hramos

fbshipit-source-id: 383f4a820cf5bf261dbfdcff3b950f9812a65e00
  • Loading branch information
janicduplessis authored and facebook-github-bot committed Sep 19, 2018
1 parent df2c4f2 commit 5586187
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Libraries/Components/TextInput/InputAccessoryView.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

const ColorPropType = require('ColorPropType');
const DeprecatedViewPropTypes = require('DeprecatedViewPropTypes');
const Platform = require('Platform');
const React = require('React');
const StyleSheet = require('StyleSheet');

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5586187

Please sign in to comment.