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

[Question]: JSX+ slot scope 在 typescript 中存在不可绕过的编译问题 #1877

Closed
SoloJiang opened this issue May 14, 2020 · 6 comments
Assignees

Comments

@SoloJiang
Copy link
Collaborator

<View x-slot:header="props"></View>

以上用法在 ts 项目中会存在无法绕过的编译错误。

@imsobear
Copy link
Collaborator

具体的编译错误是?

@SoloJiang
Copy link
Collaborator Author

image

@SoloJiang
Copy link
Collaborator Author

image

@xfantasy
Copy link

我也遇到了,实际代码是:

<NavigationBar title={"我的钱包"} optionTitle={'账单'}>
   <View x-slot:titleExtraAddons><Text>123</Text></View>
</NavigationBar>

编译时报错:
image

@muzea
Copy link

muzea commented Jul 27, 2020

TS 中已经有相关 PR 在做这个事情

Support xml namespaces in JSX
Support xml namespace prefix for JSX elements and attributes

@SoloJiang
Copy link
Collaborator Author

新版本 rax-app 已经升级到 TypeScript 4.x,支持了 JSX Plus 和 TypeScript 一起使用,针对 x-for 场景,需要做如下变更:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants