[DOC] add information about reactivity

This commit is contained in:
Géry Debongnie
2022-02-24 13:45:24 +01:00
committed by Samuel Degueldre
parent 1ae9d514b9
commit f405fe9323
3 changed files with 36 additions and 2 deletions
+5
View File
@@ -25,6 +25,11 @@ To solve this issue, Owl provides two reactivity primitives:
Most of the time, the `useState` hook is the best solution.
Since version 2.0, Owl applies the fine grained reactivity at the component
level: props are automatically turned into reactive object, so Owl can track
which part of these props are consumed by each component, and is therefore able
to only rerender the impacted components.
## `useState`
Let us start by an example of how `useState` could be used: