DEV Community

Matthew Horvat
Matthew Horvat

Posted on

2

Material UI Datepicker and @date-io/date-fns 2.0.0

The Need

I was working on a project at work, being it was a React project and needing a datepicker, it was time to try the MaterialUI Datepicker.

Installing the packages

Following the documentation at material-ui my dependencies looked like this.

Alt Text

Copying and pasting the example in:
Alt Text

Fail Whale

I was greeted with the following result:
Alt Text

The Googling

Like all good developers I began to google and found a Github issue that matched my problem. The solution was to use an earlier version of the @date-io/date-fns library since a new 2.0.0 version had just come out 4 days prior and @material-ui had issues with it, being it was newer than the last release of material.

Downgrading

So I downgraded to the earlier version and this was the dependencies I ended up with:
Alt Text

Success

Finally after choosing the earlier version I was successful.
Alt Text

** Sometimes newer isn't always better **

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (1)

Collapse
 
hariprasadr92 profile image
Hariprasad Ramakrishnan

Faced the same issue and solved it the same way few days back. Looks like we walked through the same path.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay