I want to create a custom picker Component, I want to pass data to parent after each change in state, I tried using `this.props.onChange` in the render method and pass states that I want to use in the parent.
When I use `consol.log` it logs the values that I want but when I use 
`value=> this.setState({value})` I get this error:

`Unhandled JS Exception: Invariant Violation: Invariant Violation: Maximum update depth exceeded.`

here is my code:

```
export default class DatePicker extends React.Component {

    state = {
        days:31,
        month: 1,
        day : 1,
        year : 9500
    };

    render() {
        const {day, month, year} = this.state

        this.props.onChange({day,month, year})
        return(

               <View style={{flex:1 ,flexDirection:'row'}}> 

               <Picker
                         selectedValue={this.state.year}
                         enabled={false}
                         style={{height: 10, width: 70}}
                         onValueChange={(itemValue, itemIndex) =>
                             this.setState({year: itemValue})
                         }>
                        {[...Array(12).keys()].map(i => <Picker.Item label={(i+9500).toString()} value={i+9500} /> )}

                         </Picker>

                         <Picker
                         selectedValue={this.state.text}
                         enabled={false}
                         style={{height: 0, width: 70}}
                         onValueChange={(itemValue, itemIndex) =>
                             this.setState({text: itemValue, days: itemValue < 6? 31 : 30 })
                         }>
                         {date.map(i => <Picker.Item label={i.label} value={i.value} /> )}

                         </Picker>
                         <Picker
                         selectedValue={this.state.day}
                         enabled={false}
                         style={{height: 10, width: 70}}
                         onValueChange={(itemValue, itemIndex) =>
                             this.setState({day: itemValue})
                         }>
                        {[...Array(this.state.days).keys()].map(i => <Picker.Item label={(i+1).toString()} value={i+1} /> )}

                         </Picker>

                         </View>

        )

    }
}

```

**TL;DR**
=========

I want to create a component which has OnChange props like `<TextInput>` What is the best way to do that?