Commit 2465d4e4 authored by Sebastián Trebuňák's avatar Sebastián Trebuňák
Browse files

Expo doesn't support React.memo() yet...

parent b73e652b
......@@ -26,18 +26,22 @@ export default class BranchScreen extends PureComponent {
<FlatList
keyExtractor={this._keyExtractor}
renderItem={this._renderItem}
// ItemSeparatorComponent={<BranchListItem.Divider />}
ItemSeparatorComponent={BranchListItemDivider}
data={this.state.data}
/>
);
}
}
const BranchListItem = memo(({ item }) => (
<ListItem title={item.address} subtitle={`${item.city}, ${item.zip}`} />
));
const BranchListItem = memo(function ListItem({ item }) {
return (
<ListItem title={item.address} subtitle={`${item.city}, ${item.zip}`} />
);
});
// const BranchListItemDivider = memo(() => <Divider style={styles.divider} />);
function BranchListItemDivider() {
return <Divider style={styles.divider} />;
}
const styles = StyleSheet.create({
container: {
......@@ -45,7 +49,7 @@ const styles = StyleSheet.create({
backgroundColor: "#fff"
},
divider: {
backgroundColor: "#ccc",
backgroundColor: "#000",
marginLeft: "10%",
width: "90%"
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment