gpt4 book ai didi

React-native: super 表达式必须为空或函数

转载 作者:行者123 更新时间:2023-12-05 07:24:33 25 4
gpt4 key购买 nike

This Is the Error I received我见过类似的问题,但我似乎无法确定问题所在。我正在使用 react-native-cli: 2.0.1react-native: 0.58.0-rc.2 我刚刚开始学习 React-Native。所以,我的代码非常基础

import React , {Component} from 'react';
import { View, Text, StyleSheet } from 'react-native';

class GroupPin extends Component {

render() {
return (
<View style={styles.container}>
<Text>Hello World !!</Text>
</View>
);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
}
});

export default GroupPin;

这是我的 App.Js 文件

import React from 'react';
import Component from 'react';
import { StyleSheet, Platform, Image, Text, View, ScrollView } from 'react-native';
import firebase from 'react-native-firebase';
import GroupPin from './Screens/GroupPin';

export default class App extends Component {

async componentDidMount() {
// TODO: You: Do firebase things
// const { user } = await firebase.auth().signInAnonymously();
// console.warn('User -> ', user.toJSON());

// await firebase.analytics().logEvent('foo', { bar: '123'});
}

render() {
return <GroupPin />;
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},

});

最佳答案

通过更改解决了它[

export default class App extends Component

]到

export default class App extends React. Component 

关于React-native: super 表达式必须为空或函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55361677/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com