[compiler] Add regression test for useEffectEvent reading a variable …
GitHub Commits - Example: React

[compiler] Add regression test for useEffectEvent reading a variable …

Commit Summary

  • PR: #37618
  • Fixes: #37209
  • Commit: 98cec2e
  • Parent: 2c68870

Changes

  • 2 files changed
  • 130 additions, 0 deletions

Description

The stale value from the issue does not reproduce on main anymore. The compiler leaves the useEffectEvent callback unmemoized, so it always reads the latest value. I added the repro from the issue as a test fixture so this stays covered. The new fixture passes with yarn snap.

File Changes

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler

  • 101 additions, 0 deletions

Additional fixture file

  • 29 additions, 0 deletions

Diff Overview

Both files show only line additions (marked with +). The first file adds 101 lines (lines 1-101 in the diff), and the second file adds 29 lines (lines 1-29 in the diff). No deletions or modifications to existing lines are present.

Comments

No comments yet. Start the discussion.