question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Component crashes if "month" view were omitted

See original GitHub issue

Do you want to request a feature or report a bug?

bug

What’s the current behavior?

When “month” is not included in views list and defaultView prop is not changed from its default value: “month”, app crashes with an error:

Uncaught TypeError: Cannot read property 'title' of undefined
    at ProxyComponent.render (Calendar.js:313)
    at ProxyComponent.hotComponentRender (react-hot-loader.development.js:622)
    at ProxyComponent.proxiedRender (react-hot-loader.development.js:637)
    at finishClassComponent (react-dom.development.js:13727)
    at updateClassComponent (react-dom.development.js:13690)
    at beginWork (react-dom.development.js:14489)
    at performUnitOfWork (react-dom.development.js:17014)
    at workLoop (react-dom.development.js:17054)
    at HTMLUnknownElement.callCallback (react-dom.development.js:149)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:199)
    at invokeGuardedCallback (react-dom.development.js:256)
    at replayUnitOfWork (react-dom.development.js:16366)
    at renderRoot (react-dom.development.js:17148)
    at performWorkOnRoot (react-dom.development.js:17993)
    at performWork (react-dom.development.js:17901)
    at performSyncWork (react-dom.development.js:17873)
    at requestWork (react-dom.development.js:17761)
    at retrySuspendedRoot (react-dom.development.js:17460)
    at wrapped (scheduler-tracing.development.js:200)

What’s the expected behavior?

It takes time to go into source code and figure out why its crashing.

Would be nice to at least warn user that they should redefine defaultView in this case if not redefine it automatically or have some feedback.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
EngrKhizarIqbalcommented, Nov 20, 2018
constructor(props) {
        super(props);
        this.state = {
            calenderView: this.props.calenderView
        };
    }
componentWillReceiveProps(nextProps) {
        if (nextProps && nextProps.calenderView) {
            this.setState({ calenderView: nextProps.calenderView });
        }
    }

And in parent container,

constructor(props) {
        super(props);
        this.state = update({
             .....
            calenderView: "month",
        });
    }

render() {
....
return <Calendar data={calendarEvents} companyEventTypes={companyEventTypes} onPeriodChange={this.loadCalendarEvents} onView={this.onView} calenderView={this.props.calenderView} />
}
0reactions
stale[bot]commented, May 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash in background on iOS 15 EXC_CRASH (SIGKILL)
Hello, Since the first iOS 15 beta and even with all the next public releases, we have a very weird crash each time...
Read more >
React array of objects mapping with missing key causing ...
The app understandably crashes with the "TypeError: Cannot read property 'icdCodeNum' of undefined" which in my case is due to the missing " ......
Read more >
What do you do when Unreal Editor crashes? - YouTube
Take a deep breath. Bugs are annoying, but they're ultimately knowable. Whether you know your way around a debugger or you just want...
Read more >
Crashing using BoolTools - Extensions - SketchUp Community
Have been using BoolTools throughout the model until it crashed on one hole. Now every attempt results in a crash. Have eliminated other ......
Read more >
8 Practices In React That Will Crash Your App In The Future
A lot of us have fallen in love with the react library for several reasons. ... Inside our App component, if dates ends...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found