What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAgHgBwjALgAgBMEAzAQygBsCSoA7OXASwjvwFkBPAQU0wAoAlPmAAdNvhgJcsNgB4AMkzoIAakzBQylJgC8yzVvjgALMngC8wYIQNlk+ANoBaAIwAafAAZPH-ACZPAGYAXQBfMPwAegA+AG5xMPFxOFYwAiUVdU1tPQMWNgt8fkwYCEwwYQsYkXF8YzSCYGMzPHxIotLysAS6Ooa6dJEiO3b8ItNzXF7+1MGCW1wEQnH8EiZqBBgAeShcAHUhGYlaBkM2dc2YADkEAHN8gDcEMH4mJYBbYTEJeqkZGBsd4ID69epJPoneiMAprDZLHZ7Q7ffp-aSyEa4MgAOkuCP4eK2twezGelTB7WSEn+GLkhCYjxiNgMy2xACsIMp+KIQJ4eYIwnIovTGb0wnEQGEgA
Repro steps
In a component assign to a variable the result of a named function call that's defined lower down in the code, that named function calling another named function that's defined higher up than it.
As per the above example, you would get this error (ignore the line numbers):
LineVisualization.js:15 Uncaught ReferenceError: Cannot access 'filterNegatives' before initialization
at filterOutW (LineVisualization.js:15:24)
at LineVisualization (LineVisualization.js:8:17)
How often does this bug happen?
Every time
What version of React are you using?
18.2.0
What version of React Compiler are you using?
19.1.0-rc.2
What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAgHgBwjALgAgBMEAzAQygBsCSoA7OXASwjvwFkBPAQU0wAoAlPmAAdNvhgJcsNgB4AMkzoIAakzBQylJgC8yzVvjgALMngC8wYIQNlk+ANoBaAIwAafAAZPH-ACZPAGYAXQBfMPwAegA+AG5xMPFxOFYwAiUVdU1tPQMWNgt8fkwYCEwwYQsYkXF8YzSCYGMzPHxIotLysAS6Ooa6dJEiO3b8ItNzXF7+1MGCW1wEQnH8EiZqBBgAeShcAHUhGYlaBkM2dc2YADkEAHN8gDcEMH4mJYBbYTEJeqkZGBsd4ID69epJPoneiMAprDZLHZ7Q7ffp-aSyEa4MgAOkuCP4eK2twezGelTB7WSEn+GLkhCYjxiNgMy2xACsIMp+KIQJ4eYIwnIovTGb0wnEQGEgA
Repro steps
In a component assign to a variable the result of a named function call that's defined lower down in the code, that named function calling another named function that's defined higher up than it.
As per the above example, you would get this error (ignore the line numbers):
LineVisualization.js:15 Uncaught ReferenceError: Cannot access 'filterNegatives' before initialization
at filterOutW (LineVisualization.js:15:24)
at LineVisualization (LineVisualization.js:8:17)
How often does this bug happen?
Every time
What version of React are you using?
18.2.0
What version of React Compiler are you using?
19.1.0-rc.2