Skip to content

Commit

Permalink
docs: fix book chapter 3.9 #3 (#2053)
Browse files Browse the repository at this point in the history
* Fix book chapter 3.9 #3

* Add note about Layout and Content
  • Loading branch information
jollygreenlaser authored Nov 29, 2023
1 parent b95a792 commit 75c27e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/book/src/view/08_parent_child.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub fn App() -> impl IntoView {


#[component]
pub fn ButtonC<F>() -> impl IntoView {
pub fn ButtonC() -> impl IntoView {
view! {
<button>"Toggle"</button>
}
Expand Down Expand Up @@ -261,7 +261,7 @@ Isn’t there some way to skip levels?

There is!

### The Context API
### 4.1 The Context API

You can provide data that skips levels by using [`provide_context`](https://docs.rs/leptos/latest/leptos/fn.provide_context.html)
and [`use_context`](https://docs.rs/leptos/latest/leptos/fn.use_context.html). Contexts are identified
Expand All @@ -284,6 +284,7 @@ pub fn App() -> impl IntoView {
}

// <Layout/> and <Content/> omitted
// To work in this version, drop their references to set_toggled

#[component]
pub fn ButtonD() -> impl IntoView {
Expand Down

0 comments on commit 75c27e0

Please sign in to comment.