Skip to content

Functional components type error ts2322 #68

Closed
@nicefan

Description

@nicefan

<VIf condition={true}>

不能将类型“{ condition: boolean | undefined; }”分配给类型“{ props: any; }”。
类型“{ props: any; }”上不存在属性“condition”。ts(2322)

如果改成 (ctx)=><div>ctx.props.condition</div> 没问题
这种写法在非jsx中 注册到components中的时候控制台也会报类型错误,但不影响编译

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions