我在我的react-native
android項目中使用react-native-router-flux。無法解決模塊`react-native-router-flux'
當我運行我的項目時,它在我的emulator
上顯示下面的錯誤。
操作系統:Ubuntu的16.04
index.android
import React, { Component } from 'react';
import {AppRegistry,StyleSheet,Text,View,Image} from 'react-native';
import {Scene, Router} from 'react-native-router-flux';
import Movie from './src/view/Movies';
export default class testreact extends Component {
render() {
return
<Router >
<Scene key="root">
<Scene key="Movie" component={Movie} title="Movie"/>
</Scene>
</Router>
}
}
AppRegistry.registerComponent('testreact',() => testreact);
電影
import React, {Component} from 'react';
import {AppRegistry, StyleSheet,Text, View,Image} from 'react-native';
import styles from './../res/styles/style';
var MOCKED_MOVIES_DATA = [
{title: 'Title', year: '2015', posters: {thumbnail: 'http://i.imgur.com/UePbdph.jpg'}},
];
class Movies extends Component {
render() {
var movie = MOCKED_MOVIES_DATA[0];
return (
<View style={styles.container}>
<Text>Title : {movie.title}</Text>
<Text>Year : {movie.year}</Text>
<Image source={{uri:movie.posters.thumbnail}} style={styles.thumbnail}/>
</View>
);
}
}
export default Movies;