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

react18 严格模式下, 切换 图表类型 不渲染 #1546

Open
vaynevayne opened this issue Jun 26, 2023 · 1 comment
Open

react18 严格模式下, 切换 图表类型 不渲染 #1546

vaynevayne opened this issue Jun 26, 2023 · 1 comment

Comments

@vaynevayne
Copy link

vaynevayne commented Jun 26, 2023

  {_value.geomType === 'line' ? (
          <>
            line
            <Chart
              key={'line'}
         
              autoFit
              height={250}
              data={chartData}
            >
           
              <Line position={`${_value.x}*${_value.y}`} color={_value.z} />
            </Chart>
          </>
        ) : null}
        {_value.geomType === 'interval' ? (
          <>
            interval
            <Chart
              key={'interval'}
           
              autoFit
              height={250}
              data={chartData || []}
            >
              <Interval />
            </Chart>
          </>
        ) : null}

放在 dom里的line 和 interval 字符串都切换渲染了,但是图表切换时,会显示
image

@vaynevayne
Copy link
Author

https://developer.aliyun.com/article/1167184
已解决, 怀疑是严格模式下 dom 节点没删除导致的

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

No branches or pull requests

1 participant