1

I can fire the calendar of AirBnb react-dates within the render function of React,but if I try out in a function referenced within of redux-form, there is no error and it display the initial dates correctly but when clicking don't fire the calendar

BELOW WORKS
class Landing extends React.Component {
    state
    ....
     render(){
         return (<form>
                  <DateRangePicker (+props) />
                </form>)
      }
}

BELOW DISPLAY THE INITIAL FIELDS WITH THE DATES AND THERE ARE NO 
ERRORS, BUT WHEN CLICKING DON'T FIRE THE CALENDAR
 Class Landing extends React.Component {
    state
    ....
     renderCalendar=()=>{
          return (<DateRangePicker (+props)/>)
       }
     render(){
         return (
           <form>
             <Field component={this.renderCalendar}/>// Field from 
                                                        react-redux
           </form>
          )
      }
}
user1881983
  • 115
  • 2
  • 14

1 Answers1

0

I sorted taking away all the code of react-dates to another component. So, I have two components: In one component is the code of redux-form and where importing the custom component DatePicker. In the component DatePicker is where I placed all regarding react-dates with its component The trick worked.

user1881983
  • 115
  • 2
  • 14