2

PRO TIP

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 REACT_EDITOR=atom to your .bashrc.

.bashrc:

export GOROOT=/usr/local/go

export REACT_EDITOR=atom 
Opal
  • 81,889
  • 28
  • 189
  • 210
sailei
  • 65
  • 1
  • 1
  • 4
  • I'm voting to close this question as off-topic because it's not a question. – miku May 07 '15 at 07:01
  • 3
    That's not a question. If you want to provide information like this, you must follow the Stack Overflow Q&A format: good, clear, well researched question in the question box, detailed answer in the answer box. – Mat May 07 '15 at 07:01
  • I'm voting to close this question as off-topic because this question does not follow the Q&A format. – Daedalus Sep 17 '15 at 06:31
  • 1
    "PRO TIP" is what the output of the react-native-cli show when you click on an error message. – Rayron Victor Jul 31 '17 at 19:17

3 Answers3

17

For Visual Studio Code

Add code below to ~/.zshrc or ~/.bashrc file

export PATH=$PATH:/Applications/Visual\ Studio\ Code.app/Contents/Resources/app/bin
export REACT_EDITOR=code
binhapp
  • 409
  • 5
  • 10
3

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 REACT_EDITOR=atom to your .bashrc.

# .bashrc
export GOROOT=/usr/local/go
export REACT_EDITOR=atom 
Thilo
  • 257,207
  • 101
  • 511
  • 656
1

To set it up, you can add something like REACT_EDITOR=atom to your .bashrc or .profile.

    #.profile
    export NVM_DIR="/usr/local/nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm
    export REACT_EDITOR="atom" # Add atom to REACT_EDITOR for scripting

If you do make any edits to this file once you have closed it, you need to run the command in your command line:

    source ~/.profile 

to compile your newly applied edits. If you see any errors after sourcing your file get them fixed before moving to the final step. For my example,it works in .profile,but doesn't work in .bashrc. I guess it is related with NVM_DIR path.I hope it can help you:)

Lv0
  • 11
  • 3