Ludovico Fischer 29404f087e Correct setState() usage in tutorial
Summary:
If the new state depends on the previous state, if I remember correctly, it’s safer to use  `setState()` with a function argument to ensure we’re not reading from an outdated `state`.

Thanks for submitting a PR! Please read these instructions carefully:

- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

The tutorial suggests to use `setState()` with an object argument when the new state depends on the previous state. In such situations, it’s preferable to use a function to ensure the previous state is up-to-date.

Updates documentation only, so there are no additional tests. Rendering the site.

Sign the [CLA][2], if you haven't already.

Small pull requests are much easier to review and more likely to get merged. Make sure th
Closes https://github.com/facebook/react-native/pull/13358

Differential Revision: D4852404

Pulled By: hramos

fbshipit-source-id: 834759e16bcfbd5a8de71bf0c56f2b154f3321e1
2017-04-07 13:31:06 -07:00
..
2017-04-05 19:02:48 -07:00
2017-03-06 18:01:06 -08:00
2017-04-05 19:02:48 -07:00
2017-03-31 09:06:00 -07:00
2017-02-17 15:02:23 -08:00
2017-03-14 17:01:56 -07:00
2017-03-10 13:05:02 -08:00
2017-03-14 16:46:00 -07:00
2017-03-01 11:50:03 -08:00
2017-03-10 13:05:02 -08:00
2017-01-10 01:28:26 -08:00
2017-03-24 18:45:58 -07:00
2017-04-07 13:31:06 -07:00
2017-03-06 18:01:06 -08:00
2017-04-05 19:02:48 -07:00
2017-02-23 16:31:41 -08:00
2017-03-10 13:05:02 -08:00
2017-02-28 06:23:58 -08:00