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.

TypeError: undefined is not an object (evaluating 'datesList[_this.state.numVisibleDays - 1].date')

See original GitHub issue

HI, i’ve added a calendar strip instance like this:

<CalendarStrip style={{ height: 100, paddingTop: 10, paddingBottom: 10 }} minDate={moment()} maxDate={moment().add(10, "days")} datesBlacklist={(date) => { return (date.isoWeekday() === 6 || date.isoWeekday() === 7); }} />

But i’m getting an error: TypeError: undefined is not an object (evaluating ‘datesList[_this.state.numVisibleDays - 1].date’)

If i remove the “datesBlacklist” property, it works but i need to disable saturdays and sundays.

I’m using version => “react-native-calendar-strip”: “^2.2.3”

Thanks in advance.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Marcoo09commented, Oct 18, 2021

In 2.2.5 I have not this problem anymore

1reaction
peacechencommented, Jul 14, 2021

Thanks again @mtimofiiv for updating the PR. The fix has been published in 2.2.4

Read more comments on GitHub >

github_iconTop Results From Across the Web

Undefined is not an object evaluating this.state. - Stack Overflow
When I try to press my button to call the addData function, I get this error: undefined is not an object (evaluating this.state.name)...
Read more >
TypeError: undefined is not an object (evaluating 'state.login ...
I have developed an application for my internship like a year ago and it was working without any problem.Now I'm trying to write...
Read more >
undefined is not an object (evaluating 'datesList[_this.state ...
TypeError : undefined is not an object (evaluating 'datesList[_this.state.numVisibleDays - 1].date')
Read more >
typeerror: undefined is not an object (evaluating 'state.card.item')
1 Answer. You are using this.setState inside a functional component. You cannot mix those two together (you can only use it inside a...
Read more >
LWC - TypeError: undefined is not an object (evaluating 'e ...
You need to de-reference the value array before you add it to the second one. Try changing the last line above to: this.userConditionsLWC1.push( ......
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