3

I'm working with calenders for the first time in react and found react-big-calender interesting. I've created the calender with some events but I'm experiencing some console errors which I'm not familiar with.

Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate 
bugs in your code. 

* Move data fetching code or side effects to componentDidUpdate. 
* If you're updating state whenever props change, refactor your code to use memoization techniques or 
  move it to static getDerivedStateFromProps.

Please update the following components: DayColumn, TimeGrid, TimeGutter

Can someone explain this to me? Thank you!

Also, I would like to know if its possible to only display month view and not all (day,week,agenda) views.

Here is my code :

   render(){

    const localizer = momentLocalizer(moment)

    const holidays = []  

    this.state.holidays.map((holiday,index) => {

        let start = moment(holiday.for_date).toDate()
        holidays.push({ start: start, 
                        end: start, 
                        color: holiday.color, 
                        key:index, 
                        title:holiday.title})
        })

    const list = [...holidays]     

   return(
   <div className="calender">
     <Calendar
       localizer={localizer}
       events={list}
       defaultDate={moment().toDate()}
       startAccessor="start"
       endAccessor="end"
     />
  </div>
  )}
Surya Mahla
  • 483
  • 5
  • 20

1 Answers1

1

In brief, what this means is that the maintainers of the NPM package, Big Calendar, have not yet updated their code to move away from deprecated features, specifically componentWillReceiveProps, in the case of this warning.

There's nothing you can do on your side in your app.

It does look like there is some progress, as can be seen here.

Kim
  • 856
  • 1
  • 11
  • 21