Skip to content

React ApexCharts v2.1.1

Latest

Choose a tag to compare

@junedchhipa junedchhipa released this 19 Jun 13:31
· 6 commits to master since this release

πŸ› Bug fixes

Fixed a crash on chart teardown β€” Cannot read properties of undefined (reading 'node') (#602)

When a chart was rendered or updated while its container was detached from the DOM - e.g. it's closed/hidden and reopened, a modal or tab unmounts it, or a queued window-resize redraw fired right after unmount - the underlying chart instance never finished setting up its SVG. The subsequent teardown then dereferenced an undefined element and threw. Because this happened inside React's useEffect cleanup, it could crash the entire component tree, not just the chart. The crash was commonly reported alongside chart.id and responsive options, which share the same teardown/resize path.

The unmount cleanup is now guarded across all client and hydrate entry points, so a teardown error can no longer crash your React tree β€” on any installed apexcharts version.

This pairs with the root-cause fix in apexcharts@5.15.1. For the complete fix, upgrade both:

npm i apexcharts@^5.15.1 react-apexcharts@^2.1.1