I want to change the value of true to false from the Navbar.svelte component
index.svelte
<script>
import Cart from "../lib/Cart.svelte";
import Navbar from "../lib/Navbar.svelte";
</script>
<div>
<Cart />
<Navbar/>
</div>
In this file, the initial value is true
Cart.svelte
<script>
let hidden = true
</script>
{#if hidden}
<div class="box">
<button on:click={() => hidden = false}>x</button>
</div>
{/if}
<style>
.box {
width: 64px;
height: 64px;
background-color: black;
}
</style>
It is necessary to change the value in cart.svelte from true to false from this component when clicking on the button
Navbar.svelte
<script>
</script>
<div>
<button>HIDDEN</button>
</div>