Skip to content

Commit ee88ee0

Browse files
committed
docs(readme): add note about synchronous state
1 parent 945ce7e commit ee88ee0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,21 @@ export default class App extends Component {
4242

4343
- Your state can use any valid JavaScript. Feel free to use nested objects, arrays, expando properties, getters/setters, inheritance and ES6 collections directly.
4444

45+
- The state is just an object, which updates synchronously when you update it. You don't have to worry about the asynchronous nature of `setState`.
46+
4547
- State mutations are picked up and they trigger the render method when appropriate.
4648

4749
- The render method is only triggered if it is affected by state mutations. If it doesn't use the mutated part of the state or the mutation doesn't change the state, the render method is not triggered.
4850

49-
- The render method is never executed immediately. Triggered renders are collected in a batch and executed in one go after a small delay.
51+
- The render method is never executed immediately. Triggered renders are collected and executed asynchronously in one batch.
5052

5153
- Duplicates renders are removed. A render never runs twice in one batch - no matter how many times it got triggered. Renders run in first trigger order.
5254

5355
- Renders may trigger others renders by mutating the state. In this case loops are automatically resolved.
5456

5557
- Renders always run before the next repaint.
5658

57-
As a result a stable and fresh state and view is always achieved before the next repaint with the minimal number of required renders.
59+
As a result the state is always fresh and a stable and fresh view is always achieved before the next repaint with the minimal number of required renders.
5860

5961
## Examples with live demos
6062

0 commit comments

Comments
 (0)