我有一個視圖,我試圖通過react-native-router-flux模塊加載。反應本地路由器通量不顯示屏幕
但是,它沒有顯示模擬器上的屏幕。但是,我可以在react-dev工具中看到我的組件。
我在Android模擬器上看不到任何錯誤,只是空的屏幕。詳細信息如下:
Test.js:
import React from 'react';
import { Text, View } from 'react-native';
const Test =() => {
return (
<View style={{margin: 128}}>
<Text>This is PageTwo!</Text>
</View>
);
};
export default Test;
我的路由器:Router.js
import React, { Component } from 'react';
import { Router, Scene } from 'react-native-router-flux';
import LoginForm from './components/LoginForm';
import Test from './components/Test';
class RouterComponent extends Component {
render() {
return (
<Router>
<Scene key="root" >
<Scene key="pageOne" component={Test} title="PageOne" initial={true} />
<Scene key="pageTwo" component={LoginForm} title="PageOne" initial={false} />
</Scene>
</Router>
);
}
}
export default RouterComponent;
我的應用程序加載器:
import React, { Component } from 'react';
import { View } from 'react-native';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import firebase from 'firebase';
import ReduxThunk from 'redux-thunk';
import reducers from './reducers';
import RouterComponent from './Router';
import LoginForm from './components/LoginForm';
class App extends Component {
componentWillMount() {
// Initialize Firebase
}
render() {
return (
<Provider store={createStore(reducers, {}, applyMiddleware(ReduxThunk))}>
<View>
<RouterComponent />
</View>
</Provider>
);
}
}
export default App;
Android模擬器屏幕:
陣營開發工具:
的package.json:
請幫助。
同樣在這裏。試圖研究源代碼... –