javascript - 如何使用 React Native 设置 Sublime 3,以便当您单击错误并跳转到您的代码时?

标签 javascript reactjs sublimetext3 react-native

如何使用 React Native 设置 sublime 3?它说添加“添加类似
REACT_EDITOR=atom 到您的 .bashrc”。

在哪里可以添加或编辑 REACT_EDITOR?

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.

最佳答案

我和你的想法一样。您可以执行以下操作:

1.我们应该确保sublime可以在终端命令中使用。所以首先我们制作 sublime 终端命令。

sudo rm -rf/usr/local/bin/subl

sudo ln -s/Applications/Sublime\Text.app/Contents/SharedSupport/bin/subl/usr/local/bin

然后我们运行 subl sublime.txt 你会发现它有效。

  1. 我们应该更改 .bashrc.zshrc(如果您安装了 oh my zsh),添加

export REACT_EDITOR=subl

3.我们重启终端,运行react native project,然后点击报错信息。奇妙的事情将会发生 :) 玩得开心!

enter image description here

关于javascript - 如何使用 React Native 设置 Sublime 3,以便当您单击错误并跳转到您的代码时?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32806509/

相关文章:

android - react native : Is there a native module for accessing and scanning files (e. g。音频文件)在android的sdcard中

reactjs - 与 MUI 的 useStyles() react ,给我违反钩子(Hook)规则

javascript - JS 检查数值属性是否存在

javascript - MUI 自动完成 onchange 不会在芯片删除时触发

javascript - d3 条形图将文本附加到条形图

sublimetext - 针对特定语法禁用 Sublime Text Minimap

c++ - Sublime文本在为c++ 14创建构建系统时出现错误

ruby-on-rails - RuboCop:线路太长 ← 如何忽略?

javascript - 我怎样才能在Javascript中解析这个日期?

javascript - React抛出错误: Cannot read property 'map' of undefined