mirror of
https://github.com/facebook/react.git
synced 2026-02-26 18:58:05 +00:00
10 lines
260 B
JavaScript
10 lines
260 B
JavaScript
// @debug
|
|
function Component(props) {
|
|
const ref = useRef(null);
|
|
const renderItem = (item) => {
|
|
const current = ref.current;
|
|
return <Foo item={item} current={current} />;
|
|
};
|
|
return <Items>{props.items.map((item) => renderItem(item))}</Items>;
|
|
}
|