Hello everyone,
When I publish my expo project, I have the the error “Uncaught error : Application main has not been registered”. So it seems that I have to register my main component.
My problem is that my main app component is inside a function because I use Mobx and I have to send my stores inside. Here is my react.tsx :
import React from 'react';
import { Provider } from 'mobx-react';
import Routes from '../container/routes';
import FlashMessage from 'react-native-flash-message';
import { ThemeProvider } from 'react-native-elements';
export default function(stores: any) {
return class App extends React.Component {
render() {
return (
<ThemeProvider>
<Provider {...stores}>
<Routes />
</Provider>
<FlashMessage position="top" />
</ThemeProvider>
);
}
};
}
Then I have an index.tsx :
import mobx from './mobx';
import components from './react';
export default function() {
const stores = mobx();
return components(stores);
}
Which is used in an app.tsx :
import boot from './boot/index';
const app = boot();
export default app;
And last, but not least, my App.js file :
import app from './src/app';
export default app;
So I would like to use the registerRootComponent(App);
function to register the App component. But I tried to use it in the react.tsx file, in the App.tsx file, but each time I have the same error “main application non registered”…
Do you have any idea how I could register my component ? I would be so happy if you find the solution
I use the SDK 34.0.0, and I develop the app for iOS and Android, if these informations could be importants.
Thank you all for the expo project !