【发布时间】:2017-03-26 11:08:43
【问题描述】:
我正在做这个 react-native 项目,我正在使用 this method 来组织我的项目文件,但我不知道如何在 const 中声明函数。
import React from 'react';
import { View, ListView, Text } from 'react-native';
const Category = (props) => {
const ds = ListView.DataSource({rowHasChanged : (r1, r2) => r1 !== r2});
// how to declare function here?
return (
<View>
<ListView
dataSource={ds}
renderRow={(rowData) => <Text>{rowData}</Text>}
renderSeparator={// how to put function reference here?}
/>
</View>
);
}
【问题讨论】: