how can i achieve this ?
const element = () => {
return <div>
<Container1 />
<Container2 />
</div>
}
const Container1 = () => {
return <div className="container-1"></div>
}
const Container2 = () => {
const [preview,setPreview] = useState(true)
return
<div className="container-2">
{preview ? <div className="preview"></div> : ""}
</div>
}
so what i want is that if preview is shown then apply style on container-1 and if it’s achievable with css
2
Answers
Easiest way will be
Try this example