я просто добавилЯ только что добавил var React = require ('react-native'); и вся моя сборка не удалось
var React = require('react-native');
к моему index.ios.js файл, но когда я перезагрузить My Реагировать родное приложение, это приходит:
Я попытался изменить разрешения для модуля с активной реакцией, выполнив
sudo chmod -R 777 ExampleProject
sudo chmod -R 777 ExampleProject/node_modules/react-native
но i t все еще не работает. Что я сделал не так?
Это полный исходный код моего index.ios.js файла:
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View
} from 'react-native';
class Logbook extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.ios.js
</Text>
<Text style={styles.instructions}>
Press Cmd+R to reload,{'\n'}
Cmd+D or shake for dev menu
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('Logbook',() => Logbook);
Вы можете включать весь код своего 'index.ios.js' файл? –
Несомненно @DaveSibiski –