Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TreeSelect] triggerRender 入参的 TS 类型不应为可选 #532

Closed
boomboomchen opened this issue Jan 12, 2022 · 1 comment
Closed

[TreeSelect] triggerRender 入参的 TS 类型不应为可选 #532

boomboomchen opened this issue Jan 12, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@boomboomchen
Copy link
Collaborator

Which Component 出现bug的组件

  • TreeSelect

semi-ui version

  • latest

Expected result 期望的结果是什么

Actual result 实际的结果是什么

Steps to reproduce 复现步骤

  • 1

Reproducible code 复现代码

Type '(triggerProps: TriggerRenderProps) => JSX.Element' is not assignable to type '(props?: TriggerRenderProps | undefined) => ReactNode'.
Types of parameters 'triggerProps' and 'props' are incompatible.
Type 'TriggerRenderProps | undefined' is not assignable to type 'TriggerRenderProps'.
Type 'undefined' is not assignable to type 'TriggerRenderProps'.ts(2322)

<TreeSelect
            value={value}
            onChange={(value) => setValue(value as string)}
            triggerRender={triggerRender} //此处会ts报错
            treeData={treeData}
            defaultOpen
            filterTreeNode
          />

Additional information 补充说明

  • 遇到这个bug的业务场景、上下文、或者你的需求场景
@boomboomchen boomboomchen added the bug Something isn't working label Jan 12, 2022
@boomboomchen boomboomchen self-assigned this Jan 12, 2022
@YyumeiZhang
Copy link
Collaborator

ts v4.9.5未复现该问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants