TypeError: undefined is not an object (evaluating 'datesList[_this.state.numVisibleDays - 1].date')
See original GitHub issueHI, 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:
- Created 2 years ago
- Reactions:2
- Comments:11 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In 2.2.5 I have not this problem anymore
Thanks again @mtimofiiv for updating the PR. The fix has been published in 2.2.4