📅  最后修改于: 2022-03-11 15:02:21.600000             🧑  作者: Mango
const { useState } = React;
function PageComponent() {
const [count, setCount] = useState(0);
const increment = () => {
setCount(count + 1)
}
return (
count {count}
(count should be updated from child)
);
}
const ChildComponent = ({ onClick, count }) => {
return (
)
};
ReactDOM.render( , document.getElementById("root"));