From 3d6a5eb828de5bb2b0624a56c3dfed53ba40e691 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 17 Dec 2021 16:45:35 +0100 Subject: [PATCH] [REM] doc: remove overview page --- README.md | 1 - doc/learning/overview.md | 133 --------------------------------------- 2 files changed, 134 deletions(-) delete mode 100644 doc/learning/overview.md diff --git a/README.md b/README.md index 6fe8b377..6c50309e 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,6 @@ More interesting examples can be found on the Are you new to Owl? This is the place to start! - [Tutorial: create a TodoList application](doc/learning/tutorial_todoapp.md) -- [Quick Overview](doc/learning/overview.md) - [How to start an Owl project](doc/learning/quick_start.md) - [How to test Components](doc/learning/how_to_test.md) - [How to write Single File Components](doc/learning/how_to_write_sfc.md) diff --git a/doc/learning/overview.md b/doc/learning/overview.md deleted file mode 100644 index 46605028..00000000 --- a/doc/learning/overview.md +++ /dev/null @@ -1,133 +0,0 @@ -# 🦉 Quick Overview 🦉 - -Owl components in an application are used to define a (dynamic) tree of components. - -``` - Root - / \ - A B - / \ - C D -``` - -**State:** each component can manage its own local state. It is a simple ES6 -class, there are no special rules: - -```js -class Counter extends Component { - static template = xml` - `; - - state = { value: 0 }; - - increment() { - this.state.value++; - this.render(); - } -} -``` - -The example above shows a component with a local state. Note that since there -is nothing magical to the `state` object, we need to manually call the `render` -function whenever we update it. This can quickly become annoying (and not -efficient if we do it too much). There is a better way: using the `useState` -hook, which transforms an object into a reactive version of itself: - -```js -const { useState } = owl.hooks; - -class Counter extends Component { - static template = xml` - `; - - state = useState({ value: 0 }); - - increment() { - this.state.value++; - } -} -``` - -Note that the `t-on-click` handler can even be replaced by an inline statement: - -```xml -