Skip to content

Commit

Permalink
docs: update the basic projection tutorial (#5093)
Browse files Browse the repository at this point in the history
  • Loading branch information
wtlin1228 authored Sep 5, 2023
1 parent 14c594e commit 14bab7b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/docs/src/routes/tutorial/projection/basic/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ contributors:
- manucorporat
- adamdbradley
- literalpie
- wtlin1228
---

Projection is a way of passing content to a child component that in turn controls where the content is rendered. Projection is a collaboration between the parent and child component. The parent component decides what is the content that needs to be rendered, while the child component decides where and if the content should be rendered.
Expand All @@ -23,4 +24,4 @@ For Qwik, the `<Slot>` approach is preferable because it declaratively controls

Change the `<Panel>` component to project the `<App>` content using the `<Slot>` element.

Notice that the `<App>` is re-render on button click, but the `<Panel>` is not re-rendered on interaction. This is because `<Slot/>` is declarative and allows Qwik to know where the content should be projected even if `<Panel>` is not loaded.
Notice that both `<App>` and `<Panel>` are not re-render on button click. This is because the reactivity graph is built on the server and serialized into the HTML, so Qwik knows what to update without needing to download and re-render the templates of `<App>` and `<Panel>`.

0 comments on commit 14bab7b

Please sign in to comment.