title: How to dynamically decide to pass a prop to a react component or not?
body: <p>I'm using KeyboardAvoidingView and I want to pass a prop 'behaviour' to it in case the platform is IOS and none in case it's android. I don't wanna write two separate JSX component declarations  for the same. Is there a way to decide to pass a prop or not. Also react-native's docs don't mention any default value for the behaviour props which I could have set conditionally otherwise.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>Based on the platform the component should be declared the following way
  
  FOR IOS
  &lt;KeyboardAvoidingView behavior="padding" style={modalContainer} &gt;
    {this.props.children} //I've lots of children here and they're composed inside of the keyboardavoidingview and i'm not using this.props.children as they're in the same parent component
  &lt;/KeyBoardAvoidingView&gt;
  
  
  FOR ANDROID
  &lt;KeyboardAvoidingView style={modalContainer} &gt;
    {this.props.children}
  &lt;/KeyBoardAvoidingView&gt;</code></pre>
  </div>
  </div>
  </p>