I'm starting a project I want to adapt a Highchart stockChart
react component to a regular Highchart (chart
) component. I was adjusting it on a demo and everything was working fine.
When I moved to my local project I couldn't change constructorType
from stockChart
to chart
, it compiles but when I try to run the application I get this error
TypeError: t[n] is not a function
t
C:/src/HighchartsReact.js:30
27 | const H = props.highcharts || Highcharts;
28 | const constructorType = props.constructorType || 'chart';
29 |
> 30 | if (!H) {
| ^ 31 | console.warn('The "highcharts" property was not passed.');
32 |
33 | } else if (!H[constructorType]) {
(anonymous function)
C:/src/HighchartsReact.js:52
49 | }
50 |
51 | if (!chartRef.current) {
> 52 | createChart();
| ^ 53 | } else {
54 | if (props.allowChartUpdate !== false) {
55 | if (!props.immutable && chartRef.current) {
My local project runs same dependencies as the demo, I have no clue why I'm facing this TypeError
. According to documentation this is the default call.