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>
)}