📅  最后修改于: 2022-03-11 15:04:12.708000             🧑  作者: Mango
function App() {
const [status, setStatus] = React.useState(false);
const [text, setText] = React.useState("");
const handleClick = () => {
this.setStatus(prev => ({ status: !prev.status }));
};
const handleChange = e => {
this.setStatus({ text: e.target.value });
};
return (
<>
>
);
}
const ChildComponent = ({ isOpen, text, handleChange, handleClick }) => {
return (
<>
{isOpen && (
)}
>
);
};