ant-design / ant-design/pro-components
🐛[BUG] 弹窗表单, RangePicker不能给初始值. 给了以后就报错
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
上次遇到该问题#8293, 按照大佬指示填单价参数dateFormatter={false}
### 尝试解决问题
`npm cache clean --force`
`npm install`
### 🐛 bug 描述
不给初始值, 就没有问题. 给了以后就会报错
```
const initValues: FormProps = {
...current,
dateRange: [
dayjs("2023/01/01"),
dayjs("2023/01/02"),
]
}
initialValues={initValues}
dateFormatter={false}
onFinish={async (values) => {
console.log(values)
console.log(values.dateRange[0].format("YYYY-MM-DD"))
}}
>
```
### 📷 复现步骤
无法复现, 本地始终不行,沙箱环境没有问题
https://codesandbox.io/p/sandbox/antd-rangepicker-hrpfgh?file=%2Fsrc%2FApp.tsx%3A18%2C82
### 💻 复现代码
无法复现
### 🚑 其他信息




Contributor guide
Research direction
Start with the linked CodeSandbox and the reported DrawerForm, Form.Item, and RangePicker setup using initialValues and dateFormatter={false}. First determine why the issue cannot be reproduced locally, then confirm whether the error occurs with the supplied dateRange values; done means the initial range works without the reported error and the behavior is covered by a reproducible case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100