无法使Material-UI日期选择器正常工作 [英] Cannot get material-ui datepicker to work
问题描述
由于某些原因,我无法使 material-ui 日期选择器正常工作.每次在React中渲染日期选择器时,都会引发以下错误:
For some reason, I cannot get the material-ui datepicker to work. Every time the datepicker is rendered in React, the following error is thrown:
RangeError:格式字符串包含未转义的拉丁字母字符
n
我仅用日期选择器创建了一个堆栈闪电( https: //stackblitz.com/edit/react-6ma6xd?embed=1&file=index.js ),甚至出现错误.我究竟做错了什么?我想我遵循了安装指南中的所有说明.
I have created a stackblitz with just the datepicker (https://stackblitz.com/edit/react-6ma6xd?embed=1&file=index.js) and even there the error shows up. What am I doing wrong? I think I followed all the instructions from the installation guide.
链接到material-ui/pickers: https://material-ui-pickers.dev/
Link to the material-ui/pickers: https://material-ui-pickers.dev/
推荐答案
我遇到了同样的问题,在github问题中发现了这个问题:
I had the same problem, found this in the github issues:
https://github.com/mui-org/material- ui-pickers/issues/1440 所以我安装了"@ date-io/date-fns":"^ 1.3.13"并使其正常工作
https://github.com/mui-org/material-ui-pickers/issues/1440 so i installed "@date-io/date-fns": "^1.3.13" and got it working
这篇关于无法使Material-UI日期选择器正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!