Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Calendar with MuiPickersUtilsProvider and useStaticState not working #1793

Closed
gReis89 opened this issue May 18, 2020 · 2 comments
Closed

Comments

@gReis89
Copy link

gReis89 commented May 18, 2020

A GIF or MEME to give some spice of the internet

Environment

Tech Version
@material-ui/pickers 3.2.10
material-ui 4.9.14
TypeScript
React 16.12.0
Browser any
Peer library moment 2.25.3 date-io/moment 2.6.0

Steps to reproduce

Trying to use Calendar with MuiPickersUtilsProvider and useStaticState as per example

Expected behavior

Calendar to be displayed

Actual behavior

Error
Can not find utils in context. You either a) forgot to wrap your component tree in MuiPickersUtilsProvider; or b) mixed named and direct file imports. Recommendation: use named imports from the module index.

Live example

https://codesandbox.io/s/fancy-paper-x0pcx?file=/src/App.js

@oliviertassinari
Copy link
Member

This sounds related to, if not a duplicate of #1650. Also, we have moved our effort to v4, we don't support v3. Can you reproduce the issue on http://next.material-ui-pickers.dev/?

@gReis89
Copy link
Author

gReis89 commented May 18, 2020

thanks for the refence!

I updated my code to use v4, replaced Calendar with StaticDatePicker and MuiPickersUtilsProvider with LocalizationProvider as per new docs, and everything worked.

@gReis89 gReis89 closed this as completed May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants