Closed
Description
There is no apparent way to configure the title (i.e. the html <title>) of the generated index.html file - it eems to be hard coded to "React App".
Of course I can edit the generated file, but I'd like to fully express my app in source and have my generated files production ready right out of the box.
I assume this can be accomplished with "eject" but that seems like an overkill for what should be a very common configuration requirement.
Activity
Timer commentedon Dec 12, 2016
Editing
public/index.html
is the proper way to configure your page's default title.The
public/
directory should be checked into source control.build/
is the directory which should be in your.gitignore
.Ejecting is not necessary; if you would like to mutate your title based on page check out
react-document-title
.Of course if I've misunderstood you and take your title in a more literal sense: what are you trying to accomplish by having a programmatic way to set the generated page title?
gaearon commentedon Dec 12, 2016
I added this to the docs:
https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#changing-the-page-title
I hope this helps!
annorax commentedon Dec 12, 2016
Oops, I completely missed the fact that index.html is present in the
public
folder. What threw me off is the "Using the public Folder" section of the docs, which essentially describes the public folder strictly as a way to import assets without using Webpack, and discourages use of it where avoidable. Thanks for pointing this out!gaearon commentedon Dec 12, 2016
Got it.
I hope this is a bit better: ab3913c.