Skip to content

Commit 57774a4

Browse files
chiraggshahfacebook-github-bot
authored andcommittedApr 27, 2018
Use app name from app.json for registering application
Summary: Currently when we change the app name in `app.json`, run `react-native eject` and then run the application, we get the following error `Application HelloWorld2 has not been registered` <img src="https://user-images.githubusercontent.com/6805530/34646396-9a68ccd0-f38c-11e7-9a49-9f985dc20f14.png" width="33%" /> This PR picks up the app name from app.json while registering the application, which prevents the additional step for the user to change the app name while registering in the `index.js` Tested using sinopia. The new app generated with the `react-native init HelloWorld` contains the changes made. [CLI] [ENHANCEMENT] [index.js] - App name picked from from app.json for registering application. Closes #17472 Differential Revision: D7788652 Pulled By: hramos fbshipit-source-id: bf23318ae1994b06e5d5908f53818040db1ad5af
1 parent 7b6dd2a commit 57774a4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AppRegistry } from 'react-native';
22
import App from './App';
3+
import { name as appName } from './app.json';
34

4-
AppRegistry.registerComponent('HelloWorld', () => App);
5+
AppRegistry.registerComponent(appName, () => App);

0 commit comments

Comments
 (0)