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

Allow setting id and data-testid #546

Open
joshkel opened this issue May 27, 2023 · 1 comment
Open

Allow setting id and data-testid #546

joshkel opened this issue May 27, 2023 · 1 comment

Comments

@joshkel
Copy link

joshkel commented May 27, 2023

To facilitate testing and better integrate into the DOM, it would be helpful to be able to pass standard HTML div attributes such as id, as well as HTML5 data attributes such as the data-testid attribute used by React Testing Library, to the ReactECharts component and have them appear on the <div>.

@ronny1020
Copy link

I just found a walkaround. You can refer to it before the official resolution of this.

<ReactEChartsCore
  //  ....
  onChartReady={(chart): void => {
    chart._dom.dataset.testid = 'test';
  }}
/>

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

2 participants