无法识别我的react本机项目firebase模块中的问题 我将firebase安装到了我的项目文件夹中,我可以在节点模块文件夹中看到它,但当我尝试从“firebase”导入firebase时,仍然没有发生任何事情 我不知道为什么我卸载并重新安装了它 我搜索了这个问题,但没有找到解决方案,就像firebase模块根本不存在一样 我甚至重新启动了我的电脑 我甚至不能初始化EAPP 我也尝试更改我的导入行 从“React”导入React 进口{ 看法 按钮 文本输入, 样式表, 形象,, }从“反应本机” //从“firebase”导入firebase; 从“firebase”导入*作为firebase 常量firebaseConfig={ apiKey:“AIzaSyCDh998mIGLdyHaE3EK5tRnhLY-I7jiPOY”, authDomain:“shiftorgnaizer.firebaseapp.com”, 数据库URL:“https://shiftorgnaizer.firebaseio.com", projectId:“移位器指定器”, 存储桶:“ }; 导出默认类注册扩展React.Component{ 状态={ 用户名:“”,密码:“”,电子邮件:“”,电话号码:“” } onChangeText=(键,val)=>{ this.setState({[key]:val}) } 注册=异步()=>{ const{用户名、密码、电子邮件、电话号码}=this.state } render(){ 返回( this.onChangeText('username',val)} /> this.onChangeText('password',val)} /> this.onChangeText('email',val)} /> this.onChangeText('phone_number',val)} /> ) } } const styles=StyleSheet.create({ 输入:{ 宽度:350, 身高:55, 背景颜色:“#42A5F5”, 差额:10, 填充:8, 颜色:'白色', 边界半径:14, 尺码:18, 容重:“500”, }, 容器:{ 弹性:1, 为内容辩护:“中心”, 对齐项目:“中心” } })
希望能够识别该模块并使用firebase您可以共享您的package.json文件吗?以下是最简单的安装方法无法识别我的react本机项目firebase模块中的问题 我将firebase安装到了我的项目文件夹中,我可以在节点模块文件夹中看到它,但当我尝试从“firebase”导入firebase时,仍然没有发生任何事情 我不知道为什么我卸载并重新安装了它 我搜索了这个问题,但没有找到解决方案,就像firebase模块根本不存在一样 我甚至重新启动了我的电脑 我甚至不能初始化EAPP 我也尝试更改我的导入行 从“React”导入React 进口{ 看法 按钮 文本输入, 样式表, 形象,, }从“反应本机” //从“firebase”导入firebase; 从“firebase”导入*作为firebase 常量firebaseConfig={ apiKey:“AIzaSyCDh998mIGLdyHaE3EK5tRnhLY-I7jiPOY”, authDomain:“shiftorgnaizer.firebaseapp.com”, 数据库URL:“https://shiftorgnaizer.firebaseio.com", projectId:“移位器指定器”, 存储桶:“ }; 导出默认类注册扩展React.Component{ 状态={ 用户名:“”,密码:“”,电子邮件:“”,电话号码:“” } onChangeText=(键,val)=>{ this.setState({[key]:val}) } 注册=异步()=>{ const{用户名、密码、电子邮件、电话号码}=this.state } render(){ 返回( this.onChangeText('username',val)} /> this.onChangeText('password',val)} /> this.onChangeText('email',val)} /> this.onChangeText('phone_number',val)} /> ) } } const styles=StyleSheet.create({ 输入:{ 宽度:350, 身高:55, 背景颜色:“#42A5F5”, 差额:10, 填充:8, 颜色:'白色', 边界半径:14, 尺码:18, 容重:“500”, }, 容器:{ 弹性:1, 为内容辩护:“中心”, 对齐项目:“中心” } }),firebase,react-native,Firebase,React Native,希望能够识别该模块并使用firebase您可以共享您的package.json文件吗?以下是最简单的安装方法 import React from 'react' import { View, Button, TextInput, StyleSheet, Image, } from 'react-native' // import firebase from 'firebase'; import
import React from 'react'
import {
View,
Button,
TextInput,
StyleSheet,
Image,
} from 'react-native'
// import firebase from 'firebase';
import * as firebase from 'firebase'
const firebaseConfig={
apiKey: "AIzaSyCDh998mIGLdyHaE3EK5tRnhLY-I7jiPOY",
authDomain: "shiftorgnaizer.firebaseapp.com",
databaseURL: "https://shiftorgnaizer.firebaseio.com",
projectId: "shiftorgnaizer",
storageBucket: ""
};
export default class SignUp extends React.Component {
state = {
username: '', password: '', email: '', phone_number: ''
}
onChangeText = (key, val) => {
this.setState({ [key]: val })
}
signUp = async () => {
const { username, password, email, phone_number } = this.state
}
render() {
return (
<View style={styles.container}>
<Image source={require('./Images/allImages.jpg')}
style={{width: 150,height: 100}}/>
<TextInput
style={styles.input}
placeholder='Username'
autoCapitalize="none"
placeholderTextColor='white'
onChangeText={val => this.onChangeText('username', val)}
/>
<TextInput
style={styles.input}
placeholder='Password'
secureTextEntry={true}
autoCapitalize="none"
placeholderTextColor='white'
onChangeText={val => this.onChangeText('password', val)}
/>
<TextInput
style={styles.input}
placeholder='Email'
autoCapitalize="none"
placeholderTextColor='white'
onChangeText={val => this.onChangeText('email', val)}
/>
<TextInput
style={styles.input}
placeholder='Phone Number'
autoCapitalize="none"
placeholderTextColor='white'
onChangeText={val => this.onChangeText('phone_number', val)}
/>
<Button
title='Sign Up'
onPress={this.signUp}
/>
</View>
)
}
}
const styles = StyleSheet.create({
input: {
width: 350,
height: 55,
backgroundColor: '#42A5F5',
margin: 10,
padding: 8,
color: 'white',
borderRadius: 14,
fontSize: 18,
fontWeight: '500',
},
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
}
})