Files
oxc-project__oxc/crates/oxc_react_compiler/fixtures/infer-forwardref-does-not-mark-nested-function-as-component.jsx
Boshen a2259b8e75 fix(react-compiler): scope forwardRef discovery context (#25591)
Scopes `forwardRef`/`memo` discovery context to the direct callback so nested helpers are not incorrectly compiled with stale caches. Adds regression coverage for arrow and function callbacks.

Validated with `just ready`.

AI-assisted.
2026-08-13 13:26:28 +00:00

15 lines
390 B
React

// @compilationMode:"infer"
import { forwardRef } from 'react';
const Grid = forwardRef(({ label }, ref) => {
const renderGridComponent = () => <div ref={ref}>{label}</div>;
return renderGridComponent();
});
const List = forwardRef(function ({ items }, ref) {
const renderListComponent = () => <ul ref={ref}>{items}</ul>;
return renderListComponent();
});
export { Grid, List };