jd-opensource / jd-opensource/taro-ui
[3.0.0-3.0.0-alpha.3] 日历组件marks参数失效
- Dominant language
- TypeScript
- Stars
- 4.7k
- Forks
- 740
- PR merge metrics
- No merged PRs in 30d
Description
**问题描述**
使用`AtCalendar`,并添加marks参数,希望进行标记,发生错误
**复现步骤**
```js
```
**期望行为**
希望对2020年7月24日进行标记
**报错信息**
```
Uncaught Error: Objects are not valid as a React child (found: object with keys {value}). If you meant to render a collection of children, use an array instead.
in taro-text-core (created by Index)
in Index (created by ForwardRef)
in ForwardRef (created by AtCalendarList)
in taro-view-core (created by Index)
in Index (created by ForwardRef)
in ForwardRef (created by AtCalendarList)
in taro-view-core (created by Index)
in Index (created by ForwardRef)
in ForwardRef (created by AtCalendarList)
in taro-view-core (created by Index)
in Index (created by ForwardRef)
in ForwardRef (created by AtCalendarList)
in taro-view-core (created by Index)
in Index (created by ForwardRef)
in ForwardRef (created by AtCalendarList)
in AtCalendarList (created by AtCalendarBody)
in taro-view-core (created by Index)
in Index (created by ForwardRef)
in ForwardRef (created by AtCalendarBody)
in taro-view-core (created by Index)
in Index (created by ForwardRef)
in ForwardRef (created by AtCalendarBody)
in taro-view-core (created by Index)
in Index (created by ForwardRef)
in ForwardRef (created by AtCalendarBody)
in AtCalendarBody (created by AtCalendar)
in taro-view-core (created by Index)
in Index (created by ForwardRef)
in ForwardRef (created by AtCalendar)
in AtCalendar (created by Index)
in taro-view-core (created by Index)
in Index (created by ForwardRef)
in ForwardRef (created by Index)
in Index (created by Page)
in div (created by Page)
in Page (created by AppWrapper)
in div (created by AppWrapper)
in MobXProvider (created by App)
in App (created by AppWrapper)
in AppWrapper
at throwOnInvalidObjectType (react-dom.development.js?61bb:13413)
at reconcileChildFibers (react-dom.development.js?61bb:14313)
at reconcileChildren (react-dom.development.js?61bb:16762)
at updateHostComponent (react-dom.development.js?61bb:17302)
at beginWork (react-dom.development.js?61bb:18627)
at HTMLUnknownElement.callCallback (react-dom.development.js?61bb:188)
at Object.invokeGuardedCallbackDev (react-dom.development.js?61bb:237)
at invokeGuardedCallback (react-dom.development.js?61bb:292)
at beginWork$1 (react-dom.development.js?61bb:23203)
at performUnitOfWork (react-dom.development.js?61bb:22154)
```
**系统信息**
```
Taro CLI 3.0.2 environment info:
System:
OS: Windows 10
Binaries:
Node: 12.16.3 - C:\APP\nodejs\node.EXE
npm: 6.14.4 - C:\APP\nodejs\npm.CMD
```
**补充信息**
https://github.com/NervJS/taro-ui/blob/next/packages/taro-ui/src/components/calendar/ui/date-list/index.tsx#L69
```js
{item.marks && item.marks.length > 0 ? (
{item.marks.map((mark, key) => (
{mark}
))}
) : null}
```
{mark}的值为`{value:'2020/07/24}`,不是字符串,最终导致报错。
Contributor guide
Assessment
This issue has not been assessed yet.