【问题标题】:Expo & ReactNative debugger how to make the state visible?Expo和React Native调试器如何使状态可见?
【发布时间】:2021-04-25 10:39:48
【问题描述】:

我有一个使用 Expo/Typescript 设置的 ReactNative 应用程序。

我已经下载了 ReactNativeDebugger。

我已确保 ReactNativeDebugger (RND) 的版本与 ReactNative 保持一致。

  • 调试器:0.11.6
  • ReactNativeVersion:0.63.2

我已将 RND 的端口更改为与 expos 端口 (19000) https://docs.expo.io/workflow/debugging/#react-native-debugger 对齐。

我已在 expo 应用程序中启用远程调试。

似乎与运行在 Android 物理设备上的 RND 和 ReactNativeExpo 的连接已连接:

但是,我看不到任何 redux 状态等...

我是否可以执行任何其他故障排除步骤才能真正在 React Native 调试器中查看 redux 状态?

【问题讨论】:

    标签: react-native redux expo react-native-debugger


    【解决方案1】:

    我错过了在 React Native 端设置 Redux 开发工具的部分:

    将以下内容添加到 createStore 设置允许查看 redux 状态

    /** https://github.com/zalmoxisus/redux-devtools-extension#13-use-redux-devtools-extension-package-from-npm */
    import { composeWithDevTools } from 'redux-devtools-extension';
    
    const store = createStore(combinedReducers, MyPreloadedState, composeWithDevTools(applyMiddleware(thunk)));
    

    来自https://github.com/zalmoxisus/redux-devtools-extension#13-use-redux-devtools-extension-package-from-npm

    【讨论】:

      猜你喜欢
      • 2021-02-13
      • 2018-03-31
      • 1970-01-01
      • 1970-01-01
      • 2020-10-05
      • 1970-01-01
      • 1970-01-01
      • 2022-09-29
      • 2020-03-11
      相关资源
      最近更新 更多