ant-design / ant-design/x

XMarkdown的多个自定义组件渲染,会导致多个组件同时loading

Open
#1,772 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
4.8k
Forks
1.2k
Avg merge
3d 3h
Merged PRs (30d)
2

Description

### 重现步骤

在线示例链接:
官网示例:https://next.ant-design-x.pages.dev/x-markdowns/examples-cn#docs-x-markdown-examples-demo-components

步骤:
1.将mock内容中的自定义组件重复两遍
```ts
const text = `
**GPT-Vis**, Components for GPTs, generative AI, and LLM projects. Not only UI Components. [more...](https://github.com/antvis/GPT-Vis) \n\n

Here's a visualization of Haidilao's food delivery revenue from 2013 to 2022. You can see a steady increase over the years, with notable *growth* particularly in recent years.

[{"time":2013,"value":59.3},{"time":2014,"value":64.4},{"time":2015,"value":68.9},{"time":2016,"value":74.4},{"time":2017,"value":82.7},{"time":2018,"value":91.9},{"time":2019,"value":99.1},{"time":2020,"value":101.6},{"time":2021,"value":114.4},{"time":2022,"value":121}]
这是分割线
[{"time":2020,"value":59.3},{"time":2021,"value":64.4},{"time":2022,"value":68.9},{"time":2016,"value":74.4},{"time":2017,"value":82.7},{"time":2018,"value":91.9},{"time":2019,"value":99.1},{"time":2020,"value":101.6},{"time":2021,"value":114.4},{"time":2022,"value":121}]
`;
```
2. 当第二个自定义组件loading时,第一个自定义组件又会进入loading

Image

### 当前行为

_No response_

### 预期行为

_No response_

### 上下文

_No response_

### 版本

2.0.0-alpha16

### 您在哪些浏览器上遇到了这个问题?

Chrome

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the XMarkdown custom-component example linked in the issue and reproduce the problem by duplicating the custom-line component in the mock content. Check how loading is handled when the second component loads, and consider the issue complete when each custom component keeps an independent loading state in Chrome.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.