antvis / XFlow

React component for building interactive diagrams.
https://x6.antv.antgroup.com/xflow/guide/introduction
MIT License
564 stars 233 forks source link

react18下类型“IntrinsicAttributes & IFlowchartGraphProps”上不存在属性“children” #353

Closed shmjiao closed 1 year ago

shmjiao commented 1 year ago

问题描述

React18去掉了props的children,现引入typescript的react18版本后,XFlow报错:类型“IntrinsicAttributes & IFlowchartGraphProps”上不存在属性“children”,需要更新下

重现链接

https://codesandbox.io/s/ji-chu-shi-yong-fang-fa-forked-3jjees?file=/App.tsx

重现步骤

(用如上沙盒添加types/react:18.0.28依赖即可) 1、引入Xflow,"@types/react": "18.0.28", 2、在XFlow中加入children, <XFlow className={styles['flow-user-custom-clz']} commandConfig={commandConfig} onLoad={onLoad} meta={meta}>

            <FlowchartExtension />

…… 3、引入 "@types/react": "18.0.28", "@types/react-dom": "18.0.11", "react": "18.2.0","react-dom": "18.2.0", 4、报错类型“IntrinsicAttributes & IFlowchartGraphProps”上不存在属性“children”

预期行为

不报错,兼容React18及ts

平台

  • 操作系统: [Windows, Linux, React18] "@types/react": "18.0.28", "@types/react-dom": "18.0.11", "react": "18.2.0","react-dom": "18.2.0",
  • 网页浏览器: [Google Chrome]
  • XFlow 版本: "@antv/x6": "^1.32.11", "@antv/x6-react-shape": "^1.6.1", "@antv/xflow": "^1.0.53", "@antv/xflow-core": "^1.0.53",

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

xflow-bot[bot] commented 1 year ago

👋 @shmjiao

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

Max-ChenFei commented 1 year ago

@shmjiao 你好, 要继续 修复 还是其他选择呢?

xflow-bot[bot] commented 1 year ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not-stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the AntV community! 💪💯

johnninja commented 1 year ago

有结果了?

shmjiao commented 1 year ago

@shmjiao 你好, 要继续 修复 还是其他选择呢?

需要继续修复

TSjianjiao commented 1 year ago

建一个d.ts文件,覆写react的定义

declare module 'react' {
  interface FunctionComponent<P = {}> {
    (props: PropsWithChildren<P>, context?: any): ReactElement<any, any> | null;
  }
}
shmjiao commented 1 year ago

你好,最后我用下方语句屏蔽掉了 // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore

shmjiao commented 1 year ago

建一个d.ts文件,覆写react的定义

declare module 'react' {
  interface FunctionComponent<P = {}> {
    (props: PropsWithChildren<P>, context?: any): ReactElement<any, any> | null;
  }
}

谢谢

xflow-bot[bot] commented 1 year ago

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not-stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the AntV community! 💪💯

xflow-bot[bot] commented 1 year ago

Hey again!

It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot 🤖, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the AntV community! 💪💯

ShenHongFei commented 1 year ago

It's not fixed

xflow-bot[bot] commented 1 month ago

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.