Skip to content

Instantly share code, notes, and snippets.

View frankieyan's full-sized avatar
🤯

Frankie Yan frankieyan

🤯
  • Vancouver, BC
  • 02:18 (UTC -07:00)
View GitHub Profile
@frankieyan
frankieyan / react-compiler-memoization-gap.md
Last active March 6, 2026 22:03
React Compiler: memoization gap when hook calls separate a value from its hook consumer

React Compiler: memoization gap when hook calls separate a value from its hook consumer

Summary

The React Compiler silently skips memoization of a derived value when hook calls appear between the value's definition and a hook that consumes it. This produces correct but unnecessarily unstable references, which can break patterns that depend on referential stability (e.g., useConditionalEffect in drag-and-drop).

The compiler reports no errors or warnings. The file compiles cleanly and passes react-compiler-tracker --check-files. The only signal is a runtime behavioral regression.

How we found it

@frankieyan
frankieyan / test.ts
Created July 26, 2017 20:18
StateService href
import { StateService } from "angular-ui-router";
class Blah {
/* @ngInject */
constructor(
private AlertManager: any,
private $state: StateService;
private $sce: angular.ISCEService,
) {}