Upselling ListView in ScrollView's docs

Summary:
Internal research at FB has shown that many devs don't know why they should use ListView instead of ScrollView, or that ListView even exists. This PR changes ScrollView's docs to upsell ListView.

I could put this as a separate guide in the docs, but I think this place will have the best possible reach for target audience.

Suggestions welcome. Let me know if it doesn't make sense or is too verbose.
Closes https://github.com/facebook/react-native/pull/11349

Differential Revision: D4292109

Pulled By: mkonicek

fbshipit-source-id: e4a14e5a55333c9282d0e407461505e71e850b20
This commit is contained in:
Martin Konicek 2016-12-07 10:40:59 -08:00 committed by Facebook Github Bot
parent de82931931
commit 3ab508e99a
1 changed files with 15 additions and 0 deletions

View File

@ -44,6 +44,21 @@ const requireNativeComponent = require('requireNativeComponent');
*
* Doesn't yet support other contained responders from blocking this scroll
* view from becoming the responder.
*
*
* `<ScrollView>` vs `<ListView>` - which one to use?
* ScrollView simply renders all its react child components at once. That
* makes it very easy to understand and use.
* On the other hand, this has a performance downside. Imagine you have a very
* long list of items you want to display, worth of couple of your ScrollViews
* heights. Creating JS components and native views upfront for all its items,
* which may not even be shown, will contribute to slow rendering of your
* screen and increased memory usage.
*
* This is where ListView comes into play. ListView renders items lazily,
* just when they are about to appear. This laziness comes at cost of a more
* complicated API, which is worth it unless you are rendering a small fixed
* set of items.
*/
const ScrollView = React.createClass({
propTypes: {