mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-27 19:25:11 +08:00
Summary: Flow typing can be annoying because the `renderItem` prop for FlatList always has to specifically be of type `React.Element`. Since really we just want to return something renderable, it should be fine to type this as `React.Node` instead. I'm not sure if this is valid, but it seems like since we just need to implant the `key` property, we should be able to accomplish this with a `React.Fragment` wrapper instead of needing to call `cloneElement`. Looking for feedback on if this is a sensible fix. Changelog: [General][Changed] Updated FlatList's renderItem Flow type from React.Element<any> to React.Node Reviewed By: sahrens Differential Revision: D14814805 fbshipit-source-id: ce6793dea5a92619babe048dcfddee0e4519979c