我有一个LoginForm.js
组件
import { React, Component } from 'react';
import { Button, Card, CardSection } from './common';
class LoginForm extends Component {
render() {
return (
<Card>
<CardSection />
<CardSection />
<CardSection>
<Button>
Login
</Button>
</CardSection>
</Card>
);
}
}
export default LoginForm;
我试图像这样将它集成到我的 App.js 中
import React, { Component } from 'react';
import { View } from 'react-native';
import firebase from 'firebase';
import { Header } from './components/common';
import LoginForm from './components/LoginForm';
class App extends Component {
componentWillMount() {
firebase.initializeApp({
apiKey: '*********',
authDomain: 'rn-auth-a3fb5.firebaseapp.com',
databaseURL: 'https://rn-auth-a3fb5.firebaseio.com',
projectId: 'rn-auth-a3fb5',
storageBucket: 'rn-auth-a3fb5.appspot.com',
messagingSenderId: '34567890'
});
}
render() {
return (
<View>
<Header headerText='Authentication' />
<LoginForm />
</View>
);
}
}
export default App;
我一直收到错误
TypeError:无法读取未定义的属性“createElement”
此错误位于: 在 LoginForm (at App.js:26) 在 RCTView (at View.js:43) 在 App (at renderApplication.js:32) 在 RCTView (at View.js:43) 在 RCTView (at View.js:43) 在 AppContainer (在 renderApplication.js:31)
我希望得到这样的东西
如何进一步调试呢?