Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !6386
Something went wrong while fetching comments. Please try again.

Revert removal of newlines from html in docs

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/JBallin/docs-env-html into master 6 years ago
  • Overview 8
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: JBallin

An unintended change was merged in #6062

Compare
  • master (base)

and
  • latest version
    66f4c1b4
    1 commit, 2 years ago

1 file
+ 7
- 1

    Preferences

    File browser
    Compare changes
docusaurus/docs/adding-custom-environment-variables.md
+ 7
- 1
  • View file @ 66f4c1b4

  • Edit in single-file editor

  • Open in Web IDE


@@ -41,13 +41,19 @@ During the build, `process.env.REACT_APP_NOT_SECRET_CODE` will be replaced with
@@ -41,13 +41,19 @@ During the build, `process.env.REACT_APP_NOT_SECRET_CODE` will be replaced with
When you load the app in the browser and inspect the `<input>`, you will see its value set to `abcdef`, and the bold text will show the environment provided when using `npm start`:
When you load the app in the browser and inspect the `<input>`, you will see its value set to `abcdef`, and the bold text will show the environment provided when using `npm start`:
 
<!-- prettier-ignore-start -->
 
```html
```html
<div>
<div>
<small>You are running this application in <b>development</b> mode.</small>
<small>You are running this application in <b>development</b> mode.</small>
<form><input type="hidden" value="abcdef" /></form>
<form>
 
<input type="hidden" value="abcdef" />
 
</form>
</div>
</div>
```
```
 
<!-- prettier-ignore-end -->
 
The above form is looking for a variable called `REACT_APP_NOT_SECRET_CODE` from the environment. In order to consume this value, we need to have it defined in the environment. This can be done using two ways: either in your shell or in a `.env` file. Both of these ways are described in the next few sections.
The above form is looking for a variable called `REACT_APP_NOT_SECRET_CODE` from the environment. In order to consume this value, we need to have it defined in the environment. This can be done using two ways: either in your shell or in a `.env` file. Both of these ways are described in the next few sections.
Having access to the `NODE_ENV` is also useful for performing actions conditionally:
Having access to the `NODE_ENV` is also useful for performing actions conditionally:
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
1
CLA Signed
1
CLA Signed
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference: facebook/create-react-app!321
Source branch: github/fork/JBallin/docs-env-html

Menu

Explore Projects Groups Snippets