📅  最后修改于: 2022-03-11 15:04:13.445000             🧑  作者: Mango
const EnhancedTable = ({ parentCallback }) => {
const [count, setCount] = useState(0);
return (
)
};
class PageComponent extends React.Component {
callback = (count) => {
// do something with value in parent component, like save to state
}
render() {
return (
count 0
(count should be updated from child)
)
}
}