react-native/Examples
Spencer Ahrens 2a1ab36257 Breaking API change - abandon `ItemComponent` in favor of `renderItem`
Summary:
After a fair bit of use, we have concluded that the `ItemComponent` mechanism is not worth the
hassle. Flow has trouble type checking it thoroughly, requiring an 'item' prop is annoying, and it
is very common to need to capture `this` anyway, e.g. for an `onPress` handler. A common pattern was
something like:

  _renderItem = ({item}) => <MyItem foo={item.foo} onPress={() => this._onPress(item)} />};
  ...
  ItemComponent={this._renderItem}

which wouldn't flow check the props and doesn't benefit from reusing components.

If we find some specific patterns that would benefit from the `ItemComponent` pattern, we can create
a new component that provides that API and wraps `FlatList` under the hood.

I'm going to do `SectionList` in a stacked diff.

Reviewed By: bvaughn

Differential Revision: D4625338

fbshipit-source-id: a4901f1c9d77e0115b0b8032b8c210f624e97ea3
2017-02-28 02:17:23 -08:00
..
2048 Update React Native minimum OS version to iOS8 2016-09-01 19:43:47 -07:00
Movies Add @providesModule annotations 2017-02-27 14:04:56 -08:00
TicTacToe Apply auto-formatter for BUCK files in fbandroid. 2017-02-27 14:04:56 -08:00
UIExplorer Breaking API change - abandon `ItemComponent` in favor of `renderItem` 2017-02-28 02:17:23 -08:00
.eslintrc Add global flow types to eslint globals 2016-01-27 15:55:34 -08:00