我开始了一个新的反应原生项目。制作了一个目录,该目录作为其他“页面”,如登录等。我在这里做了所有事情:https ://github.com/aksonov/react-native-router-flux/blob/master/docs/MINI_TUTORIAL.md
但我都看到顶部的登录标题。它只是不起作用,我不知道该怎么做。以下是代码:
index.android.js
import React, { Component } from 'react';
import { AppRegistry, StyleSheet, Text, View } from 'react-native';
import { Actions, Scene, Router } from 'react-native-router-flux';
import Login from './components/Login';
import Home from './components/Home';
export default class Yeni extends Component {
render() {
return (
<Router>
<Scene key="root">
<Scene key="login" component={Login} title="Login" initial={true} />
<Scene key="home" component={Home} title="Home" />
</Scene>
</Router>
)
}
}
AppRegistry.registerComponent('Yeni', () => Yeni);
组件/Login.js
import React, { Component } from 'react';
import { AppRegistry, Text, View } from 'react-native';
export default class Login extends Component {
render() {
return (
<View>
<Text>Login page</Text>
</View>
)
}
}