Fix error when clicking on header on default view#2647
Conversation
|
I am curious about the crash message you received. Can you copy/paste that here? |
|
@adrienharnay Did you see my notes above? |
Apologies for the slow response, here is the error:
|
|
@adrienharnay Look at my reviews for how to address this |
Your reviews? Apologies, I did not understand. |
|
You should see my reviews on the 'Files Changed' tab of this PR. Basically I said "do this instead" handleRangeChange = (date, viewComponent, view) => {
let { onRangeChange, localizer } = this.props
if (onRangeChange) {
if (viewComponent?.range) {
onRangeChange(viewComponent.range(date, { localizer }), view)
} else {
if (process.env.NODE_ENV !== 'production') {
console.error('onRangeChange prop not supported for this view')
}
}
}
} |
Hi, sorry for the late response. I am not sure your code review has been submitted, I cannot see it. In any case, thank you for the suggested changes, I have applied them! |
|
Hi @cutterbl, can we get this merged? |

Hello,
I noticed that when clicking the text in the header on default view, the
handleRangeChangewould be invoked withviewComponent===undefined.I have patched the package to avoid the error logs, and am submitting this fix. Feel free to modify if needs be!