Reputation: 43
I want to change entry point of my expo app. I have tried these simple steps:
First of all, I have created a simple expo project.
$ expo init test
$ cd test
$ rm App.js
$ mkdir src
$ touch src/App.js
I have changed app.json of my expo based app as follows
{
"expo": {
...,
entryPoint: "./src/App.js",
...
}
}
Then i have filled the App.js as folows
import React from "react";
import { Text } from "react-native";
export default () => <Text>Hello World</Text>;
However, the first trial have been failed. It have shown only splash screen.
Then i have edited the App.js as follows:
import React from "react";
import { Text } from "react-native";
import { registerRootComponent } from "expo";
const App = () => <Text>Hello World</Text>;
registerRootComponent(App);
I have seen "Hello World" text in the screen. However, hotreloading have not been working. Then i have modified main entry in package.json
"main": "./src/App.js",
In this way hot reloading is working in second save action.
I am wondering
Upvotes: 0
Views: 7402
Reputation: 822
I suggest you read this article:
https://docs.expo.dev/versions/latest/sdk/register-root-component/#what-if-i-want-to-name-my
and be sure you restarted your whole dev process
Upvotes: 1