diff --git a/src/islands.md b/src/islands.md index fe19f34..8467db0 100644 --- a/src/islands.md +++ b/src/islands.md @@ -354,15 +354,22 @@ And let’s modify the `Tab` island to use that context to show or hide itself: ```rust #[island] -fn Tab(children: Children) -> impl IntoView { +fn Tab(index: usize, children: Children) -> impl IntoView { let selected = expect_context::>(); view! { -
-// ... +
+ {children()} +
+ } +} ``` Now the tabs behave exactly as I’d expect. `Tabs` passes the signal via context to each `Tab`, which uses it to determine whether it should be open or not.