V
RN - это мобильное приложение написанное не "на js", а "с использованием js", мобильным, со всеми своими нюансами, оно не перестаёт быть.
а js и сама архитектура rn туда только добавляют особенностей.
Size: a a a
V
EY
VP
V
A
SL
NL
k
NL
k
FS
MI
const MenuNavigator = createStackNavigator({
Menu: {screen: Menu},
DishDetail: {screen: DishDetail}
}, {
initialRouteName: 'Menu',
navigationOptions: {
headerStyle: {
backgroundColor: '#512DA8'
},
headerTintColor: '#fff',
headerTitleStyle: {
color: '#fff'
}
}
});
export class Menu extends React.Component {
constructor(props) {
super(props);
this.state = {
dishes: DISHES
}
}
static navigationOptions = {
title: 'Menu'
};
render() {
const {navigate} = this.props.navigation;
const renderMenuItem = ({item, index}) => {
return (
<ListItem
key={index}
title={item.name}
subtitle={item.description}
hideChevron={true}
leftAvatar={{ source: require('./images/uthappizza.png') }}
onPress={() => navigate('DishDetail', {dishId: item.id})}
/>
)
};
return (
<FlatList
data={this.props.dishes}
renderItem={renderMenuItem}
keyExtractor={item => item.id.toString()}
/>
)
}
}
MI
EY
MI
MI
EY
MI
ДР