Navigation doesn't work.
See original GitHub issueHello! Love the plugin, but can’t get it to work correctly.
I’m using create-react-app
and I’m not sure if that’s the problem. Here’s my package.json
{
"name": "sh-calendar-client",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.4.0",
"react-calendar": "^2.15.0",
"react-dom": "^16.4.0",
"react-scripts": "1.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
All I did was create a new app, delete the default App and just paste the example code:
import React, { Component } from 'react';
import Calendar from 'react-calendar';
class MyApp extends Component {
state = {
date: new Date(),
}
onChange = date => this.setState({ date })
render() {
return (
<div>
<Calendar
onChange={this.onChange}
value={this.state.date}
/>
</div>
);
}
}
I get a working calendar as expected. The onChange
method works fine. But I can’t change the month or the year. The arrow navigation does nothing. And If I click on the title, it changes the view correctly (year, century, etc) but the arrows continue to not work and no matter what year or month I select, it falls back to the date in value
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to Troubleshoot Common Problems with a Gps ... - wikiHow
1. Make sure the GPS unit has power. If your GPS is not turning on or starting up, use the following steps to...
Read more >How to Fix Google Maps When It's Not Working on Android
One of the many reasons Google Maps won't function is due to its cache and system files. The Maps app stores certain temporary...
Read more >How to fix Maps when it crashes - Android - Google Maps Help
If the Google Maps app on your phone or tablet crashes or has other issues that affect your experience on Maps, try the...
Read more >Help I am lost and my GPS does not work on my car wifi or ...
This is probably the most common reason why the GPS doesn't work. Sometimes we forget to enable location services in our apps.
Read more >How to Fix Android GPS Not Working Issue
How to Fix GPS Not Working Issue · 1. Check the GPS Status · 2. Switch the GPS Off and On · 3....
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
The issue has been fixed. Please refer to #78 for more details.
Guys, this change was caused by a breaking change in minor version (!) of React 16.4. I’m working on a fix as I write. You should be able to resolve the issue by downgrading to React 16.3 or by wait for my hotfix.
Details
activeStartDate
was calculated every time props were changed. It was then saved in component’s state, and updated by Navigation component when you clicked the arrows. This was fine until Facebook has changed the behavior. From React 16.4getDerivedStateFromProps
is called on setState as well. Now, to make it work with React 16.4, activeStartDate will be updated when props which affect activeStartDate were changed.