Skip to content

fix(modal): type notation should be parenthesized in ModalFuncProps #4667

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

Conversation

ShenQingchuan
Copy link
Contributor

@tangjinzhou Sorry for #4664,我找到病根了

原本的类型定义是这样的:

title?: () => VNodeTypes | VNodeTypes;

这意味着 TS 认为 title 是一个函数,返回的是 VNodeTypes | VNodeTypes
也就是 VNodeTypes 本身

该错误可详见 Playground Reproduce:
https://www.typescriptlang.org/play?#code/C4TwDgpgBAglC8UDOwBOBLAdgcygHykwFcBbAIwlQG4AoUSKAIQSgAoBKBAPln1lpoAbCMChkAXExYByFBhzSB9aAGEWcAh278aQA

所以应该改为:

title: VNodeTypes | (() => VNodeTypes)

@ShenQingchuan ShenQingchuan changed the title fix: type notation should be parenthesized in ModalFuncProps fix(modal): type notation should be parenthesized in ModalFuncProps Sep 17, 2021
@tangjinzhou
Copy link
Member

再确认下 ? 这里已经改了呢 并已经发版

@tangjinzhou
Copy link
Member

title?: (() => VNodeTypes) | VNodeTypes;

注意已经加了括号了

@ShenQingchuan
Copy link
Contributor Author

好的,那我将关闭这个 PR

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants