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.

Navigation doesn't work.

See original GitHub issue

Hello! 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.

peek 2018-05-25 20-36

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
wojtekmajcommented, May 29, 2018

The issue has been fixed. Please refer to #78 for more details.

1reaction
wojtekmajcommented, May 29, 2018

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.4 getDerivedStateFromProps 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.

Read more comments on GitHub >

github_iconTop 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 >

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