使用-React-DevTools-调试小程序是什么体验

30次阅读

共计 316 个字符,预计需要花费 1 分钟才能阅读完成。

当然,React DevTools 是没法用来直接调试小程序的。

但是利用 Remax 小程序框架,我们就可以做到利用 React DevTools 来调试了。

Remax 是一个基于真正 React 开发的小程序框架,https://remaxjs.org

首先新建一个 Remax 项目(以阿里小程序为例):

$ npx create-remax-app hello-remax
$ cd hello-remax
$ npm install

安装 React DevTools 并启动:

$ npm install react-devtools -g
$ react-devtools

使用小程序开发者工具打开 hello-remax 目录,等待小程序编译完成,就能在 React Devtools 进行调试啦。

正文完
 0