Skip to content

Commit dbbc481

Browse files
docs: env var suggestions
Co-authored-by: Rene Pot <[email protected]>
1 parent 4178b36 commit dbbc481

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/migration/v12.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,17 @@ If it's not currently possible to migrate, there is an [unofficial React 18 adap
296296

297297
### `REACT_APP_` prefix no longer needed
298298

299-
Now that we're moving away from Create React App, the formatting for environment variable names has gotten simpler.
299+
With the migration away from Create React App, the formatting for environment variable names has gotten simpler.
300300

301301
As before, environment variables with names that start with `DHIS2_` are added to the app, and can be picked up from `.env` files or on the command line for example. Before, the platform had to add `REACT_APP_` before `DHIS2_` so that Create React App would add the variable to the app, so a variable like `DHIS2_MY_VAR` in the environment would become accessible on `process.env.REACT_APP_DHIS2_MY_VAR` in the app. Now, the `REACT_APP_` prefix isn't needed, so the variable can be accessed on just `process.env.DHIS2_MY_VAR`.
302302

303-
The `REACT_APP_`-prefixed variables are now deprecated, but they will be kept around alongside the shorter `DHIS2_` variables in this version for backwards compatibility. For example, both `process.env.REACT_APP_DHIS2_MY_VAR` and `process.env.DHIS2_MY_VAR` will be available. The `REACT_APP_` prefixed variables will be removed in the next version though, so make sure to migrate to just the shorter `DHIS2_` variable names.
303+
The `REACT_APP_`-prefixed variables are now deprecated and will be removed in the next major version. However they will be kept around alongside the shorter `DHIS2_` variables in this version for backwards compatibility.
304+
305+
For example, both `process.env.REACT_APP_DHIS2_MY_VAR` and `process.env.DHIS2_MY_VAR` will be available.
306+
307+
:::tip
308+
The `REACT_APP_` prefixed variables will be removed in the next version, so make sure to migrate to the shorter `DHIS2_` variable names.
309+
:::
304310

305311
### `import.meta.env`
306312

0 commit comments

Comments
 (0)