react-calendar: onChange function is not triggered on React 15.x

Hello @wojtekmaj

I am using your library in a pretty vanila way, but the call back onChange is never called when I select something a date in my calendar. Take a look:

not_working

Any idea? My version in my package.json is "react-calendar": "^2.13.0"

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 20 (8 by maintainers)

Most upvoted comments

@devsli, @kleberpinel, @yummyelin I believe the issue has been resolved in version 2.13.4. Thank you SO much for your patience. You helped me a lot. Please confirm if the fix works for you - although it does here 😃 https://codesandbox.io/s/r0989558l4

I had the same issue. Updating my React dependencies solved the issue. However, I do not explain why it didn’t work in the first place.

image

Thanks @sgnl for the links. It helped found the differences.

I think you can try the peer dependency

{ ... }
+-- react@15.6.2
| +-- create-react-class@15.6.3 deduped
| +-- fbjs@0.8.16 deduped
| +-- loose-envify@1.3.1 deduped
| +-- object-assign@4.1.1 deduped
| `-- prop-types@15.6.1 deduped
+-- react-addons-test-utils@15.6.0
+-- react-avatar-cropper@0.4.0 invalid
| +-- react@15.6.2 deduped
| +-- react-dom@15.6.2 deduped
| +-- semantic-ui-react@0.68.5 extraneous
| `-- warning@2.1.0 extraneous
+-- react-calendar@2.13.2
| +-- lodash.once@4.1.1
| +-- merge-class-names@1.1.1
| +-- prop-types@15.6.1 deduped
| +-- react@16.2.0
| `-- react-dom@16.2.0
+-- react-calendar-timeline@0.15.9
| +-- element-resize-detector@1.1.14
| +-- interact.js@1.2.8 deduped
| `-- lodash.isequal@4.5.0
+-- react-dom@15.6.2
| +-- fbjs@0.8.16 deduped
| +-- loose-envify@1.3.1 deduped
| +-- object-assign@4.1.1 deduped
| `-- prop-types@15.6.1 deduped
{ ... }

Is it enough?

Here the faulty example: https://codesandbox.io/s/2kz06l3p0

The only difference here is React and ReactDOM are of 15.6.1 version

Could you post up the example on https://codesandbox.io/ ?

I see that the docs have similar code but thanks for trying my suggestions anyway 👍

Hey @sgnl, I just tried all of them, none looks to be working.

the rendering log is just to show that is passing through that code and is rendering the component.

Any other suggestion ?

Curious as to what the errors above the “rendering” log?