mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
a2259b8e75
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.
15 lines
390 B
React
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 };
|