Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export REACT_EDITOR for VSCode

How do you complete the following PRO TIP from the Android emulator node using the Windows cmd line for VSCode?

"When you see Red Box with stack trace, you can click any stack frame to jump to the source file. The packager will launch your editor of choice. It will first look at REACT_EDITOR environment variable, then at EDITOR. To set it up, you can add something like export REACT_EDITOR=atom to your ~/.bashrc or ~/.zshrc depending on which shell you use."

Should I use export REACT_EDITOR=code?

In what directory?

I can't find ~/.bashrc or ~/.zshrc folders anywhere.

like image 548
Carl Avatar asked Apr 02 '19 14:04

Carl


2 Answers

Here's how to do it in OS X:

1) Add REACT_EDITOR=code to your .env.local file

2) Install command code by following Launching from the command line here

3) Restart debugger

4) Profit!

like image 63
Oleg Dater Avatar answered Oct 05 '22 16:10

Oleg Dater


Forgive if this answer doesn't work for android. If you're doing react for web and land here:

You can add

REACT_EDITOR=code

to an .env.local file in your project root if you use create-react-app

https://create-react-app.dev/docs/adding-custom-environment-variables

More info on the .env file pattern: https://create-react-app.dev/docs/adding-custom-environment-variables#what-other-env-files-can-be-used

like image 25
Mike Lyons Avatar answered Oct 05 '22 14:10

Mike Lyons