Renaming a React Native project?

前端 未结 16 643
独厮守ぢ
独厮守ぢ 2020-11-28 02:45

Are there instructions for what needs to be changed in order to rename a React Native project? I have an app called something along the lines of MyAppIOS and I want to renam

相关标签:
16条回答
  • 2020-11-28 03:03

    You can change the name attribute in package.json, run react-native upgrade, and just let react overwrite the android/ios files. Don't overwrite your index files if there is unsaved code, however.

    Then change your Appregistry line from

    AppRegistry.registerComponent('MyAppIOS', () => MyAppIOS);
    

    To:

    AppRegistry.registerComponent('MyApp', () => MyApp);
    
    0 讨论(0)
  • 2020-11-28 03:03

    Rename react-native app with just one command react-native-rename

    Installation

    yarn global add react-native-rename or npm install react-native-rename -g

    Usage run the below command in the project's directory.

    react-native-rename <newName>

    Example:

    react-native-rename "Travel App"

    0 讨论(0)
  • 2020-11-28 03:04

    You can use react-native-rename npm package.

    npm install react-native-rename
    react-native-rename [newName]
    

    https://www.npmjs.com/package/react-native-rename

    0 讨论(0)
  • 2020-11-28 03:07

    Solution worked for me is first change the name of the folder of your react-native project then

    npm install react-native-rename

    react-native-rename newName

    It works for me

    0 讨论(0)
  • 2020-11-28 03:10

    The following steps must be followed while renaming Project/app in react Native 1. create a new folder test

    1. Copy and paste all files from demo to test folder

    2. Change the name in package.json file

    3. Change the name in package-lock.json file

    4. Change the name in App.json file

    5. Delete /ios and /android folders

    6. Run react-native eject command to create /ios and /android folders again

    7. run react-native link for any external dependency.

    8. finally run your app by using react-native run-android command.

    Form more information visit https://youtu.be/_lgH9LXf818

    0 讨论(0)
  • 2020-11-28 03:11

    As mentioned here (https://github.com/facebook/react-native/issues/4227), you don't need to add a Bundle display name key, as said by @janus_wel.

    You can simply update Bundle name from $(PRODUCT_NAME) to My App.

    0 讨论(0)
提交回复
热议问题