diff --git a/docs/04-multiple-components.md b/docs/04-multiple-components.md
index fb49b47f..1b7674c0 100644
--- a/docs/04-multiple-components.md
+++ b/docs/04-multiple-components.md
@@ -6,12 +6,15 @@ permalink: multiple-components.html
prev: interactivity-and-dynamic-uis.html
next: reusable-components.html
---
+
So far, we've looked at how to write a single component to display data and handle user input. Next let's examine one of React's finest features: composability.
+
## Motivation: Separation of Concerns
By building modular components that reuse other components with well-defined interfaces, you get much of the same benefits that you get by using functions or classes. Specifically you can *separate the different concerns* of your app however you please simply by building new components. By building a custom component library for your application, you are expressing your UI in a way that best fits your domain.
+
## Composition Example
Let's create a simple Avatar component which shows a profile picture and username using the Facebook Graph API.
@@ -54,12 +57,14 @@ React.renderComponent(
);
```
+
## Ownership
In the above example, instances of `Avatar` *own* instances of `ProfilePic` and `ProfileLink`. In React, **an owner is the component that sets the `props` of other components**. More formally, if a component `X` is created in component `Y`'s `render()` method, it is said that `X` is *owned by* `Y`. As discussed earlier, a component cannot mutate its `props` -- they are always consistent with what its owner sets them to. This key property leads to UIs that are guaranteed to be consistent.
It's important to draw a distinciton between the owner-ownee relationship and the parent-child relationship. The owner-ownee relationship is specific to React, while the parent-child relationship is simply the one you know and love from the DOM. In the example above, `Avatar` owns the `div`, `ProfilePic` and `ProfileLink` instances, and `div` is the **parent** (but not owner) of the `ProfilePic` and `ProfileLink` instances.
+
## Children
When you create a React component instance, you can include additional React components or JavaScript expressions between the opening and closing tags like this:
@@ -70,21 +75,26 @@ When you create a React component instance, you can include additional React com
`Parent` can read its children by accessing the special `this.props.children` prop.
-### Child Reconciliation
-> Reconciliation is the process by which React updates the DOM with each new render pass.
+### Child Reconciliation
-In general, children are reconciled according to the order in which they are rendered. For example, suppose two render passes generate the following respective markup:
+**Reconciliation is the process by which React updates the DOM with each new render pass.** In general, children are reconciled according to the order in which they are rendered. For example, suppose two render passes generate the following respective markup:
```html
// Render Pass 1
- Paragraph 1 Paragraph 2 Paragraph 1 Paragraph 2 Paragraph 2 Paragraph 2
Paragraph 1
` was removed. Instead, React will reconcile the DOM by changing the text content of the first child and destroying the last child. React reconciles according to the *order* of the children. + ### Stateful Children For most components, this is not a big deal. However, for stateful components that maintain data in `this.state` across render passes, this can be very problematic. @@ -93,11 +103,18 @@ In most cases, this can be sidestepped by hiding elements instead of destroying ```html // Render Pass 1 -Paragraph 1
Paragraph 2
Paragraph 1
+Paragraph 2
+Paragraph 1
Paragraph 2
Paragraph 1
+Paragraph 2
+