Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add space in react native application name?

How can I add a space in my application name? Such as, if I do

react-native init HelloWorld

it would create an application with name HelloWorld. But if I do this

$ react-native init "Hello World"  
"Hello World" is not a valid name for a project.
Please use a valid identifier name (alphanumeric).

Is there any way to add space in the project name? I found a solution for iOS (https://github.com/facebook/react-native/issues/6115), but I'm developing for android. Please let me know how can I solve this problem.

like image 331
Provash Shoumma Avatar asked Jul 24 '16 04:07

Provash Shoumma


People also ask

How do you give a space in react-native app name?

Your projects in react-native can't have spaces in them, but you can change the app name directly in the android & ios projects. For android: go to android/app/src/main/res/values/string. xml and change app_name to your desired value.

How do I change my display name in react-native?

Just change the "displayName" then delete ios folder and run "react-native eject". Show activity on this post. replace My App with your app name.

What is space in react?

An easy to understand and nestable layout system, React Spaces allow you to divide a page or container into anchored, scrollable and resizable spaces enabling you to build desktop type user interfaces in the browser.


2 Answers

Your projects in react-native can't have spaces in them, but you can change the app name directly in the android & ios projects.

For android:
go to android/app/src/main/res/values/string.xml and change app_name to your desired value.

For ios:
Go to ios/[currentName].xcodeproj/project.pbxproj and change the PRODUCT_NAME values, both in debug and release, from the current name to your new name.

or go to ios/[currentName]/info.plist, find this:

<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>

and replace the ${PRODUCT_NAME} with your desired name

like image 184
atlanteh Avatar answered Sep 29 '22 06:09

atlanteh


Add this key in info.plist

<key>CFBundleDisplayName</key> 
<string>Top&#x2007;Articles</string>

Remember &#x2007; not worked in build setting of the project.&#x2007; this will work as space

Output:
Top Articles
like image 34
Asif vora Avatar answered Sep 29 '22 05:09

Asif vora