title: Conditional Rendering on Items of Native Base Picker [React Native]
body: <p>I’m using ‘Native Base’ components for our product and going good with this,
  but I’m stuck at one point and it is around putting Items in Nativebase Picker. My code is like this</p>
  
  <p>Render Method code - </p>
  
  <pre><code>render(){
  
    return (
  
        &lt;View style={{marginTop: 20,  flexDirection:'row', flexWrap:'wrap', justifyContent:'space-around', alignItems:'center'}}&gt;
  
          &lt;View style={{flex:1, justifyContent:'center', alignItems:'flex-end' }}&gt;
            &lt;Button
               style={{ backgroundColor: '#6FAF98', }}
               onPress={this._showDateTimePicker}
  
               &gt;
               &lt;Text&gt;Select Date&lt;/Text&gt;
            &lt;/Button&gt;
          &lt;/View&gt;
  
          &lt;View style={{flex:1, justifyContent:'center', alignItems:'stretch'}}&gt;
            &lt;Picker
                style={{borderWidth: 1, borderColor: '#2ac', alignSelf:'stretch'}}
                supportedOrientations={['portrait','landscape']}
                iosHeader="Select one"
                mode="dropdown"
                selectedValue={this.state.leaveType}
                onValueChange={(value)=&gt;this.setState({leaveType:value,})
                  //this.onValueChange.bind(this)
                }&gt;
  
                &lt;Item label="Full Day" value="leave1" /&gt;
                {
                  this.showStartDateFirstHalf() // Here I want to show this picker item on the basis of a condition 
                }
                &lt;Item label="2nd half" value="leave3" /&gt;
           &lt;/Picker&gt;
          &lt;/View&gt;
          &lt;DateTimePicker
  
            isVisible={this.state.isStartDatePickerPickerVisible}
            onConfirm={this._handleDatePicked}
            onCancel={this._hideDateTimePicker}
            mode='date'
          /&gt;
  
        &lt;/View&gt;
  
  
  
      );
  
  
  }
  
  showStartDateFirstHalf()
  {
      if(!this.state.isMultipleDays)
      {
        return(
            &lt;Item label="1st Half" value="leave2" /&gt;
        );
      }
  }
  </code></pre>
  
  <p>So, this code is working fine if <code>this.state.isMultipleDays</code> is false, But when <code>this.state.isMultipleDays</code> is true, it means when it is in <code>else</code> part then i'm getting this error -</p>
  
  <p><a href="https://i.stack.imgur.com/kKAfl.png" rel="nofollow noreferrer"><code>Cannot read property 'props' of undefined</code></a></p>