【发布时间】:2017-12-17 02:47:03
【问题描述】:
我一直在尝试通过 npm 将外部模块导入到我的 react 应用程序中,在关注 https://www.npmjs.com/package/react-native-material-design 之后,我正在尝试合并 Material design。我还从'react'导入了样式表等组件
我是原生反应新手,不明白为什么重新运行后出现以下错误:
这就是我所拥有的,我将应用注册表定义为我的应用名称是 SkysReact:
import React, { Component } from 'react';
import { Button, Card } from 'react-native-material-design';
import {
StyleSheet,
Text,
View,
Animated,
Easing,
ScrollView,
RefreshControl
} from 'react-native';
//import AwesomeComponent from "./awesome.js";
//BODY
export default class SkysReact extends Component {
render() {
return (<View>
{this.test()}
</View>);
}
test() {
console.log("Hello World")
}
animate()
{
console.log("animate");
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#000',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
color: '#333333'
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('SkysReact', () => SkysReact);
怎么了?在我添加导入之前它正在运行并且无法理解出了什么问题。
【问题讨论】:
标签: ios node.js reactjs react-native