Unblock React Compiler for 23 components across ten small causes

Each is a self-contained rewrite of syntax React Compiler cannot lower:

- `??=` -> an explicit null check
- dynamic `import()` -> a module-scope loader
- complex default parameter values -> module-scope consts
- reassigned destructured parameters -> locals
- functions used above their own declaration -> reordered
- counters mutated inside a callback -> loop index or a local object
- optional chains in a ternary test -> a hoisted const
- a computed key in a destructuring pattern -> an omitKey helper
- manual useMemo/useCallback the compiler cannot preserve -> deleted
- exhaustive-deps suppressions -> useEffectEvent

Skipped components: 125 -> 102.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tomek Zawadzki
2026-08-25 15:59:39 +02:00
parent f87fdd2ea2
commit 0283f4926e
27 changed files with 201 additions and 148 deletions
-1
View File
@@ -42,7 +42,6 @@ export function useDialogControl(): DialogOuterProps['control'] {
useEffect(() => {
activeDialogs.current.set(id, control)
return () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
activeDialogs.current.delete(id)
}
}, [id, activeDialogs])