Is it possible to change the value from a useState from inside the child component?
Parent:
const [state, setState] = useState(false);
return <Child func={() => setState(true)}/>
Child:
return <Button onClick={props.func}> Click me to set the state </Button>
It doesn't work this way, is there any way it could work? Thank you