When I click on a button, it redirects me to another component (#2) where there are two states and according to which state it shows one content or another. The default state of the component(#2) is true and what I need to know how to do is that clicking on the button of the component(#1) changes the state to false. 

This is for a ReactJs app, im using function components, hooks, no class components

```
Thats the button code:
<Link to="/register">
<button className="btn btn-success btnVerde">
</button>
</Link>

Thats the component#2:
const [state, setState] = React.useState(true);
{state && <div1......../>}
{!state && <div2......./>}

```

I expect to click on the button in component#1, it redirecto to component#2 how default state is true, and change it to false