-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "Changing the Page Title" to User Guide (#1256)
* Add "Changing the Page Title" to User Guide * Add link to main README
- Loading branch information
Showing
2 changed files
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ You can find the most recent version of this guide [here](https://github.com/fac | |
- [npm run eject](#npm-run-eject) | ||
- [Syntax Highlighting in the Editor](#syntax-highlighting-in-the-editor) | ||
- [Displaying Lint Output in the Editor](#displaying-lint-output-in-the-editor) | ||
- [Changing the Page `<title>`](#changing-the-page-title) | ||
- [Installing a Dependency](#installing-a-dependency) | ||
- [Importing a Component](#importing-a-component) | ||
- [Adding a Stylesheet](#adding-a-stylesheet) | ||
|
@@ -196,6 +197,16 @@ npm install -g [email protected] [email protected] [email protected] esl | |
|
||
We recognize that this is suboptimal, but it is currently required due to the way we hide the ESLint dependency. The ESLint team is already [working on a solution to this](https://github.com/eslint/eslint/issues/3458) so this may become unnecessary in a couple of months. | ||
|
||
## Changing the Page `<title>` | ||
|
||
You can find the source HTML file in the `public` folder of the generated project. You may edit the `<title>` tag in it to change the title from “React App” to anything else. | ||
|
||
Note that normally you wouldn't edit files in the `public` folder very often. For example, [adding a stylesheet](#adding-a-stylesheet) is is done without touching the HTML. | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
If you need to dynamically update the page title based on the content, you can use the browser [`document.title`](https://developer.mozilla.org/en-US/docs/Web/API/Document/title) API. For more complex scenarios when you want to change the title from React components, you can use [React Helmet](https://github.com/nfl/react-helmet), a third party library. | ||
|
||
Finally, if you use a custom server for your app in production and want to modify the title before it gets sent to the browser, you can follow advice in [this section](#generating-dynamic-meta-tags-on-the-server). | ||
|
||
## Installing a Dependency | ||
|
||
The generated project includes React and ReactDOM as dependencies. It also includes a set of scripts used by Create React App as a development dependency. You may install other dependencies (for example, React Router) with `npm`: | ||
|
Probably wouldn't want to raise an issue just for the "is is" typo?