Проблема в моем реагировать родной проект модуля Firebase не распознается - PullRequest
0 голосов
/ 29 сентября 2019
  • я установил firebase в папку своего проекта и вижу его в папке узловых модулей, но все же, когда я пытаюсь импортировать firebase из 'firebase', ничего не происходит
  • я не знаю, почему я удалилон установил его и переустановил
  • Я искал эту проблему, но не нашел решения, так как модуль firebase вообще не существует
  • Я даже перезагрузил компьютер
  • Я не могудаже intializeApp
  • я тоже пытался изменить свою строку импорта
    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'
      }
    })

ожидал, что распознает модуль и будет работать с firebase

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...