Browse Source

fix markup bugs

main
petehunt 11 years ago
parent
commit
050085ddeb
  1. 4
      _includes/nav_docs.html
  2. 1
      docs/03-interactivity-and-dynamic-uis.md

4
_includes/nav_docs.html

@ -2,8 +2,8 @@
<div class="nav-docs-section">
<h3>Quick start</h3>
<ul>
<li><a href="/react/docs/getting-started"{% if page.id == 'getting-started' %} class="active"{% endif %}>Getting started</a></li>
<li><a href="/react/docs/tutorial"{% if page.id == 'tutorial' %} class="active"{% endif %}>Tutorial</a></li>
<li><a href="/react/docs/getting-started.html"{% if page.id == 'getting-started' %} class="active"{% endif %}>Getting started</a></li>
<li><a href="/react/docs/tutorial.html"{% if page.id == 'tutorial' %} class="active"{% endif %}>Tutorial</a></li>
</ul>
</div>
<div class="nav-docs-section">

1
docs/03-interactivity-and-dynamic-uis.md

@ -74,6 +74,7 @@ A common pattern is to create several stateless components that just render data
### What *shouldn't* go in state?
`this.state` should only contain the minimal amount of data needed to represent your UI's state. As such, it should not contain:
* **Computed data.** Don't worry about precomputing values based on state -- it's easier to ensure that your UI is consistent if you do all computation within `render()`. For example, if you have an array of list items in state and you want to render the count as a string, simply render `this.state.listItems.length + ' list items'` in your `render()` method rather than storing it on state.
* **React components.** Build them in `render()` based on underlying props and state.
* **Duplicated data from props.** Try to use props as the source of truth where possible. Because props can change over time, it's appropriate to store props in state to be able to know its previous values.
Loading…
Cancel
Save