React-Native Expo (управляемая) Ошибка Firebase IDBIndex
Ниже приведен код для инициализации приложения firebase. Я установил модуль firebase с помощью команды expo install firebase . При использовании веб-браузера ошибок нет. Но на Expo Go я получаю следующие ошибки:
ReferenceError: Can't find variable: IDBIndex ...
Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
Я новичок в узлах и реагирующих фреймворках. Любой совет будет полезен. Спасибо
Должен ли я обновить babel.config.json? Если да, то как?
App.tsx
import { Component } from "react";
import {
DarkTheme as PaperDarkTheme,
DefaultTheme as PaperDefaultTheme,
Provider as PaperProvider,
} from "react-native-paper";
import {
NavigationContainer,
DarkTheme as NavigationDarkTheme,
DefaultTheme as NavigationDefaultTheme,
} from "@react-navigation/native";
import { createStackNavigator } from "@react-navigation/stack";
import { FirebaseApp, initializeApp } from "firebase/app";
import AppHeader from "./Components/AppHeader";
import ScreenHome from "./Components/ScreenHome";
export default class App extends Component<{}, {}> {
app: FirebaseApp;
constructor(props: any) {
super(props);
this.app = initializeApp(firebaseConfig);
this.state = {};
this.handleEvent = this.handleEvent.bind(this);
}
handleEvent() {
console.log(this.props);
}
render() {
return (
<PaperProvider theme={CombinedDefaultTheme}>
<NavigationContainer theme={CombinedDefaultTheme}>
<Stack.Navigator initialRouteName="Home">
<Stack.Screen
component={ScreenHome}
name="Home"
options={({ navigation, route }) => ({
header: (props) => <AppHeader navigation={navigation} />,
})}
/>
</Stack.Navigator>
</NavigationContainer>
</PaperProvider>
);
}
}
const CombinedDarkTheme = {
...PaperDarkTheme,
...NavigationDarkTheme,
colors: {
...PaperDarkTheme.colors,
...NavigationDarkTheme.colors,
},
};
const CombinedDefaultTheme = {
...PaperDefaultTheme,
...NavigationDefaultTheme,
colors: {
...PaperDefaultTheme.colors,
...NavigationDefaultTheme.colors,
accent: "yellow",
primary: "tomato",
},
};
const firebaseConfig = {##};
const Stack = createStackNavigator();
Babel.config.json
module.exports = function (api) {
api.cache(true);
return {
presets: ["babel-preset-expo"],
env: {
production: {
plugins: ["react-native-paper/babel"],
},
},
};
};