Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

adrienharnay
Copy link

Hello,

I noticed that when clicking the text in the header on default view, the handleRangeChange would be invoked with viewComponent === undefined.

I have patched the package to avoid the error logs, and am submitting this fix. Feel free to modify if needs be!

@cutterbl
Copy link
Collaborator

cutterbl commented Sep 5, 2024

I am curious about the crash message you received. Can you copy/paste that here?

@cutterbl
Copy link
Collaborator

@adrienharnay Did you see my notes above?

@adrienharnay
Copy link
Author

@adrienharnay Did you see my notes above?

Apologies for the slow response, here is the error:

react-dom.development.js:4312 Uncaught TypeError: Cannot read properties of undefined (reading 'range')
    at Calendar._this.handleRangeChange (react-big-calendar.esm.js:4638:27)
    at Calendar._this.handleViewChange (react-big-calendar.esm.js:4671:13)
    at Calendar._this.handleDrillDown (react-big-calendar.esm.js:4700:23)
    at notify (react-big-calendar.esm.js:187:22)
    at TimeGridHeader._this.handleHeaderClick (react-big-calendar.esm.js:3514:7)
    at onClick (react-big-calendar.esm.js:3593:27)
    at HTMLUnknownElement.callCallback (react-dom.development.js:4164:14)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:16)
    at invokeGuardedCallback (react-dom.development.js:4277:31)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:25)
Screenshot 2024-09-17 at 15 00 25

@cutterbl
Copy link
Collaborator

@adrienharnay Look at my reviews for how to address this

@adrienharnay
Copy link
Author

@adrienharnay Look at my reviews for how to address this

Your reviews? Apologies, I did not understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants