Skip to content

Commit 1b131bb

Browse files
authored
Merge pull request #1069 from preactjs/refactor/tutorial-titles
refactor: Keep tutorial titles in w/ markdown content
2 parents 9b3a7a2 + 37684b6 commit 1b131bb

31 files changed

+65
-40
lines changed

content/en/tutorial/01-vdom.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
prev: /tutorial
33
next: /tutorial/02-events
4-
title: Virtual DOM
54
solvable: true
65
---
76

7+
# Virtual DOM
8+
89
You might have heard people refer to "Virtual DOM", and wondered:
910
what makes it "virtual"? How is a "virtual" DOM different from
1011
the real DOM we use when programming for the browser?

content/en/tutorial/02-events.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
prev: /tutorial/01-vdom
33
next: /tutorial/03-components
4-
title: Events
54
solvable: true
65
---
76

7+
# Events
8+
89
Events are how we make applications interactive, responding to inputs like
910
keyboard and mouse, and reacting to changes like an image loading. Events
1011
work the same way in Preact as they do in the DOM – any event type or behavior

content/en/tutorial/03-components.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
prev: /tutorial/02-events
33
next: /tutorial/04-state
4-
title: Components
54
solvable: true
65
---
76

7+
# Components
8+
89
As we alluded to in part one of this tutorial, the key building block
910
in Virtual DOM applications is the Component. A Component is a self-contained
1011
piece of an application that can be rendered as part of the Virtual DOM

content/en/tutorial/04-state.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
prev: /tutorial/03-components
33
next: /tutorial/05-refs
4-
title: State
54
solvable: true
65
---
76

7+
# State
8+
89
Now that we know how to create HTML elements and components, and how to
910
pass props and event handlers to both using JSX, it's time to learn how
1011
to update the Virtual DOM tree.

content/en/tutorial/05-refs.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
prev: /tutorial/04-state
33
next: /tutorial/06-context
4-
title: Refs
54
solvable: true
65
---
76

7+
# Refs
8+
89
As we learned in the first chapter, the DOM provides an imperative API,
910
which lets us make changes by calling functions on elements. One example
1011
where we might need to access the imperative DOM API from a Preact

content/en/tutorial/06-context.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
prev: /tutorial/05-refs
33
next: /tutorial/07-side-effects
4-
title: Context
54
solvable: true
65
---
76

7+
# Context
8+
89
As an application grows larger, its Virtual DOM tree often becomes deeply
910
nested and composed of many different components. Components at various
1011
locations within the tree sometimes need to access common data - typically

content/en/tutorial/07-side-effects.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
prev: /tutorial/06-context
33
next: /tutorial/08-keys
4-
title: Side Effects
54
solvable: true
65
---
76

7+
# Side Effects
8+
89
Side effects are bits of code that run when changes happen in the Virtual
910
DOM tree. They don't follow the standard approach of accepting `props`
1011
and returning a new Virtual DOM tree, and often reach out of the tree

content/en/tutorial/08-keys.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
prev: /tutorial/07-side-effects
33
next: /tutorial/09-error-handling
4-
title: Keys
54
solvable: true
65
---
76

7+
# Keys
8+
89
In chapter one, we saw how Preact uses a Virtual DOM to calculate what
910
changed between two trees described by our JSX, then applies those
1011
changes to the HTML DOM to update pages. This works well for most

content/en/tutorial/09-error-handling.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
prev: /tutorial/08-keys
33
next: /tutorial/10-links
4-
title: Error Handling
54
solvable: true
65
---
76

7+
# Error Handling
8+
89
JavaScript is a flexible interpreted language, which means it's possible (and even easy)
910
to encounter errors at runtime. Whether the result of an unexpected scenario or a mistake
1011
in code we've written, it's important to be able to monitor errors and implement some form

content/en/tutorial/10-links.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
prev: /tutorial/09-error-handling
3-
title: Congratulations!
43
solvable: false
54
---
65

6+
# Congratulations!
7+
78
You've completed the Preact tutorial!
89

910
Feel free to play around a bit more with the demo code.

0 commit comments

Comments
 (0)