mirror of
https://github.com/facebook/react.git
synced 2026-02-26 07:05:09 +00:00
7 lines
169 B
JavaScript
7 lines
169 B
JavaScript
function component() {
|
|
const [count, setCount] = useState(0);
|
|
const increment = useCallback(() => setCount(count + 1));
|
|
|
|
return <Foo onClick={increment}></Foo>;
|
|
}
|