Search code examples
reactjscreate-react-app

add dollar sign characters to React app env file


I need to store variable with $ sign in env but when I`m trying to use it gets omitted.

Why is that happens and how to fix it?

REACT_APP_EXAMPLE="QWE$EWQ"

my log out next:

QWE


Solution

  • You need to "skip" (escape) the dollar sign. With the variable name, it serves as a placeholder for the variable value that will added to the string later.

    Skip it by using a backslash "\", like this: "QWE\$EWQ".