title: Get TypeError: Cannot read properties of undefined (reading 'forEach') when pass a params
body: <p>At first, the params does not have any data yet (blank array), but it will update again after <code>useEffect</code> set the variable.</p>
  <p>But for my highchart, it gave me this error.</p>
  <pre><code>TypeError: Cannot read properties of undefined (reading 'forEach')
   52 |   createChart();
   53 | } else {
   54 |   if (props.allowChartUpdate !== false) {
  &gt;55 |     if (!props.immutable &amp;&amp; chartRef.current) {
      | ^  56 |       chartRef.current.update(
   57 |         props.options,
   58 |         ...(props.updateArgs || [true, true])
  </code></pre>
  <p>I searched some solutions, they suggest can use <code>allowChartUpdate={false}</code> and <code>immutable={false}</code> for solving the problem. After I tried it, yes it does solve my problem, but my highchart doesn't show the data when initial load.</p>
  <p>I'm guessing is it the params passing in a blank array at first, then passing a second time with actual values so it causes this problem. If yes, can rerendering the highchart solve the problem? And how can I do that?</p>
  <p><a href="https://codesandbox.io/s/react-highcharts-error-kkib1?file=/src/App.js" rel="nofollow noreferrer">Here</a> is the link, please help me on it. Thank you muakzzz.</p>