TS2769: No overload matches this call
See original GitHub issue按照官方文档引用Popover组件ts报错
`import { Popover } from ‘antd-mobile’
<Popover
overlayClassName="city-tip-popover"
align={{
offset: [50, 5]
}}
placement="bottom"
overlay={[<span className="tip-content" key={city}>{city}</span>]}
>
<i className="tip-icon"></i>
</Popover>`
TS2769: No overload matches this call. Overload 1 of 2, ‘(props: Readonly<PopOverPropsType>): Popover’, gave the following error. Type ‘{ offset: number[]; }’ is not assignable to type ‘{ overflow: { adjustY: number; adjustX: number; }; }’. Object literal may only specify known properties, and ‘offset’ does not exist in type ‘{ overflow: { adjustY: number; adjustX: number; }; }’. Overload 2 of 2, ‘(props: PopOverPropsType, context?: any): Popover’, gave the following error. Type ‘{ offset: number[]; }’ is not assignable to type ‘{ overflow: { adjustY: number; adjustX: number; }; }’. Object literal may only specify known properties, and ‘offset’ does not exist in type ‘{ overflow: { adjustY: number; adjustX: number; }; }’.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top GitHub Comments
I have the same issue
`import { Toast, PullToRefresh } from ‘antd-mobile’;
No overload matches this call. Overload 1 of 2, ‘(props: Readonly<PropsType>): PullToRefresh’, gave the following error. Type ‘{ children: Element[]; damping: number; indicator: {}; direction: “down”; refreshing: boolean; onRefresh: () => void; }’ is missing the following properties from type ‘Pick<Readonly<PropsType> & Readonly<{ children?: ReactNode; }>, “children” | “style” | “getScrollContainer” | “direction” | “refreshing” | … 5 more … | “scale”>’: getScrollContainer, distanceToRefresh Overload 2 of 2, ‘(props: PropsType, context?: any): PullToRefresh’, gave the following error. Type ‘{ children: Element[]; damping: number; indicator: {}; direction: “down”; refreshing: boolean; onRefresh: () => void; }’ is missing the following properties from type ‘Pick<Readonly<PropsType> & Readonly<{ children?: ReactNode; }>, “children” | “style” | “getScrollContainer” | “direction” | “refreshing” | … 5 more … | “scale”>’: getScrollContainer, distanceToRefresh
v2 已停止维护了,可以考虑升级一下