Complete the code to import the state management function in Astro.
import { [1] } from 'astro/client';
The useSignal function is used in Astro to create reactive state that can be shared between framework islands.
Complete the code to create a shared signal named 'count' with initial value 0.
const count = [1](0);
useSignal(0) creates a reactive signal with initial value 0 in Astro.
Fix the error in passing the shared signal as a prop to a child island.
<ChildIsland count=[1] />When passing a signal as a prop in Astro, pass the signal object itself, not its value.
Fill both blanks to update the shared signal value inside a child island event handler.
function increment() {
[1].value = [2].value + 1;
}Inside the child island, the shared signal is accessed via props.count. To update, assign to props.count.value.
Fill all three blanks to create a shared signal, pass it to a child island, and update it on a button click.
const [1] = [2](0); return <ChildIsland count=[3] />;
useState instead of useSignal.First, create the signal with useSignal and name it count. Then pass count as a prop to the child island.