Я получаю следующую ошибку в своем приложении React Native:
«Необнаруженная ошибка: «Privont» не зарегистрирован. Это может произойти, если:
- < li>Metro (локальный сервер разработки) запускается из неправильной папки. Проверьте, запущен ли Metro, остановите его и перезапустите в текущем проекте.
- Не удалось загрузить модуль из-за ошибки и AppRegistry.registerComponent не вызывался."
- Перезапустил сборщик Metro.
- Проверил, что использую Metro. в правильном каталоге проекта.
- Проверил вызов AppRegistry.registerComponent в моем коде.
Вот мой код:
1. index.js
Код: Выделить всё
import * as React from 'react';
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import './Core/translations/i18next';
import {Provider} from 'react-redux';
import {PersistGate} from 'reduxjs-toolkit-persist/integration/react';
import {persistedStore, store} from './src/redux/store';
const AppWrapper = () => (
);
AppRegistry.registerComponent(appName, () => AppWrapper);
Код: Выделить всё
{
"name": "Privont",
"displayName": "Privont"
}
Код: Выделить всё
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FIRApp configure];
// Add this line to call the above function
ClearKeychainIfNecessary();
self.moduleName = @"Privont";
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... native-app
Мобильная версия