작동하지 네이티브 반작용 ...하지만 난 https://reactnavigation.org/docs/navigators/drawer 을 구현하기위한 난이 링크를 사용하여이 작업을 수행하는 데 실패하지만 난 코드는 내가 사용이 링크와는하고 있지 않다DrawerNavigator 내가 네이티브 반응에 drawernavigator을 구현하기 위해 노력하고
class MyHomeScreen extends React.Component {
static navigationOptions = {
drawer:() => ({
label: 'Home',
icon: ({ tintColor }) => (
<Image
source={require('./chats-icon.png')}
style={[styles.icon, {tintColor: tintColor}]}
/>
),
}),
}
render() {
return (
<Button
onPress={() => this.props.navigation.navigate('Notifications')}
title="Go to notifications"
/>
);
}
}
class MyNotificationsScreen extends React.Component {
static navigationOptions = {
drawer:() => ({
label: 'Notifications',
icon: ({ tintColor }) => (
<Image
source={require('./notif-icon.png')}
style={[styles.tabIcon, {tintColor: tintColor}]}
/>
),
}),
}
render() {
return (
<Button
onPress={() => this.props.navigation.goBack()}
title="Go back home"
/>
);
}
}
const styles = StyleSheet.create({
icon: {
width: 24,
height: 24,
},
});
const MyApp = DrawerNavigator({
Home: {
screen: MyHomeScreen,
},
Notifications: {
screen: MyNotificationsScreen,
},
});
AppRegistry.registerComponent('SimpleApp',() => SimpleApp);
내가 App.js 파일에 저장이 모든 데이터 ... 그리고 index.android.js 파일에 나는이 오류를 보여 작동하지 않는이 같은
import './App';
이 코드를 가져옵니다. 이것은 오류 스크린 샷입니다 Error Screen
작동하지 않는 기능은 무엇입니까? – WilomGfx
선생님 나는이 많은 링크를하지만 유를 사용한다면 아무도 – hammad
가 https://reactnavigation.org/docs/navigators/drawer – hammad