[Compiler Optimization]: avoid memoizing useState
lazy initializer functions
#31453
Open
1 of 4 tasks
useState
lazy initializer functions
#31453
What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAYhBABQAOMEVYyRwmAhgLYLJg4x6YDmAXwCUTIgB1iROIW5EA2txY4EAXSIBeIgCUELXADooYBAGUcyhBQqiNAPiaSizojAQ5YxTAgDuRACosANYIYAAyhPz+eBz+EADCEGxUUCrUtPQGrBzCTkQiANx5bh4wxEoqWewIRZiCkpJwADYsYGABwaERAtGxCUkpKo5S2ZzcvAK1zjKY41C4EDAUo6LAec5oi0QUTe5EeJpEAAwF+wDUZ6cHADxEAIwIAGyr+etEOAAWeGBVHIejU1edRAgiAA
Repro steps
useState
with the lazy state initialiser that consumes propsHowever, I'm not 100% sure this is valid React code as the docs state:
But this does seem like a valid use-case.
How often does this bug happen?
Every time
What version of React are you using?
version in playground
What version of React Compiler are you using?
version in playground
The text was updated successfully, but these errors were encountered: