HTML, React: DOMは存在させたいが非表示にさせたい
const [visible, setVisible] = useState(false);
// :
return (
<div style={visible ? undefined : { visibility: "hidden", height: 0 }}>
Hello
</div>
);
HTML, React: DOMは存在させたいが非表示にさせたい
const [visible, setVisible] = useState(false);
// :
return (
<div style={visible ? undefined : { visibility: "hidden", height: 0 }}>
Hello
</div>
);