Native Base 是否可以与 React Native 的最新列表组件一起使用?
Does Native Base work with latest List Components from React Native?
Facebook 最近发布了一些非常酷的列表组件。
"No more ListViews or DataSources, stale rows, ignored bugs, or excessive memory consumption - with the latest React Native March 2017 release candidate (0.43-rc.1) you can pick from the new suite of components what best fits your use-case, with great perf and feature sets out of the box:"
特别是
FlatList, SecionList, and VirtualisedList
Native Base 如何支持这些组件。看起来 ListView 现在已被弃用。
Nativebase 可以与新的 List 组件一起正常工作 - 您只需要使用适当的组件即可。考虑到您编写的 FlatList 组件看起来像这样。
render() {
return (
<List>
<FlatList
data={[...]}
renderItem={({ item }) => (
<ListItem>
<Text>{item.name}</Text>
</ListItem>
)}
/>
</List>
)
}
此外,ListView 目前尚未弃用。新的 List 组件仍然是新的,因此它们有一些目前 ListView 中不存在的问题。
Facebook 最近发布了一些非常酷的列表组件。
"No more ListViews or DataSources, stale rows, ignored bugs, or excessive memory consumption - with the latest React Native March 2017 release candidate (0.43-rc.1) you can pick from the new suite of components what best fits your use-case, with great perf and feature sets out of the box:"
特别是
FlatList, SecionList, and VirtualisedList
Native Base 如何支持这些组件。看起来 ListView 现在已被弃用。
Nativebase 可以与新的 List 组件一起正常工作 - 您只需要使用适当的组件即可。考虑到您编写的 FlatList 组件看起来像这样。
render() {
return (
<List>
<FlatList
data={[...]}
renderItem={({ item }) => (
<ListItem>
<Text>{item.name}</Text>
</ListItem>
)}
/>
</List>
)
}
此外,ListView 目前尚未弃用。新的 List 组件仍然是新的,因此它们有一些目前 ListView 中不存在的问题。