mirror of
https://github.com/facebook/react.git
synced 2026-02-27 03:07:57 +00:00
17 lines
316 B
JavaScript
17 lines
316 B
JavaScript
function Component(props) {
|
|
const dispatch = useDispatch();
|
|
useFreeze(dispatch);
|
|
|
|
// onUpdate should be memoized even though it doesn't
|
|
// flow into the return value
|
|
const onUpdate = () => {
|
|
dispatch({ kind: "update" });
|
|
};
|
|
|
|
useEffect(() => {
|
|
onUpdate();
|
|
}, [onUpdate]);
|
|
|
|
return <div />;
|
|
}
|