React CRACO start dev custom env variable

Posted on April 4, 2021

If you need to start a development session with CRACO or CRA, so you can have some business logic based on it, here the tip found here:

"scripts":
    "start": "craco start",
    "mock": "REACT_APP_MOCK=true craco start"
    ...

Then, the process.env.REACT_APP_MOCK will be available in your code.