I have e child component named Window and I have this useState in Window component:
Window Component:
const [showWindow, setShowWindow] = useState(false);
Imagine this is the parent component
Parent component :
/////
////
////
<Window/>
<Button/ onClick={()=>{
setShowWindow(true)
}}>
/////
/////
As it can be seen I have a Button component here and I want to set the showWindow to 'true' through it.
How can I change the useState in the child component from its parent component like this example? How can I access to it?