-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix error when clicking on header on default view #2647
base: master
Are you sure you want to change the base?
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! |
Hello,
I noticed that when clicking the text in the header on default view, the
handleRangeChange
would 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!