I am getting the next error in my React Native app:
“Uncaught Error: ‘Privont’ has not been registered. This will occur if:
- Metro (the native dev server) is run from the mistaken folder. Examine if Metro is working, cease it and restart it within the present mission.
- A module did not load resulting from an error and
AppRegistry.registerComponent
wasn’t referred to as.”
I’ve checked my code, and plainly "Privont"
hasn’t been registered. Right here’s what I’ve tried thus far:
- Restarted the Metro bundler.
- Verified that I’m working Metro within the appropriate mission listing.
- Checked the
AppRegistry.registerComponent
name in my code.
The error factors to AppRegistry.js
at line 205.
Right here is my code:
1. index.js
import * as React from 'react';
import {AppRegistry} from 'react-native';
import App from './App';
import {title as appName} from './app.json';
import './Core/translations/i18next';
import {Supplier} from 'react-redux';
import {PersistGate} from 'reduxjs-toolkit-persist/integration/react';
import {persistedStore, retailer} from './src/redux/retailer';
const AppWrapper = () => (
);
AppRegistry.registerComponent(appName, () => App);
2. app.json
{
"title": "Privont",
"displayName": "Privont"
}
3. AppDelegate.mm
@implementation AppDelegate
- (BOOL)software:(UIApplication *)software didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[FIRApp configure];
// Add this line to name the above perform
ClearKeychainIfNecessary();
self.moduleName = @"Privont";
// You'll be able to add your customized preliminary props within the dictionary beneath.
// They are going to be handed right down to the ViewController utilized by React Native.
self.initialProps = @{};
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
Right here is the error picture : See Picture