Describe the bug
In the docs we are instructed to provide highcharts like so:
provideHighcharts({
// Optional: Define the Highcharts instance dynamically
instance: () => import('highcharts'),
...
vs in the demo app, it's provided like this:
provideHighcharts({
instance: () => import('highcharts/esm/highcharts').then(m => m.default),
...
Providing it like import('highcharts') causes an issue, where if you have more than one chart on a page and one re-renders, they all re-render. You can reproduce this behavior in the demo app (steps below).
Expected behavior
Regardless of which way you provide the instance, you should not see global re-renders.
Demo
Follow the steps below in the demo app in this repo.
Steps required to recreate the problem in the demo:
- In the demo app in this repo, run
npm start
- In app.config.ts, comment out the current instance:
// instance: () => import('highcharts/esm/highcharts').then(m => m.default),
- add a new line:
instance: () => import('highcharts'),
- Save, and return to the browser.
- Click "Destroy chart" then "Recreate chart" on the first chart.
- Both of the first 2 charts re-render.
- The other charts are not rendering at all, I'm not sure what the issue is there.
- Go back to app.config.ts, change the instance back to the ESM import and save.
- Do the same steps: Click "Destroy chart" then "Recreate chart" on the first chart.
- Only the first chart re-renders.
Describe the bug
In the docs we are instructed to provide highcharts like so:
vs in the demo app, it's provided like this:
Providing it like
import('highcharts')causes an issue, where if you have more than one chart on a page and one re-renders, they all re-render. You can reproduce this behavior in the demo app (steps below).Expected behavior
Regardless of which way you provide the instance, you should not see global re-renders.
Demo
Follow the steps below in the demo app in this repo.
Steps required to recreate the problem in the demo:
npm start