【问题标题】:Not able to use actions in React Native无法在 React Native 中使用操作
【发布时间】:2021-12-06 08:42:21
【问题描述】:

我正在尝试在我的 react native 应用程序中实现 Redux 状态管理,但我遇到了一个问题。我在我的 react 应用程序中做了同样的事情,它运行良好。我正在使用打字稿模板。

export * as actionCreators from "./action-creators";

错误

TransformError src/state/index.ts: Export namespace should be first transformed by `@babel/plugin-proposal-export-namespace-from`.

【问题讨论】:

    标签: typescript react-native react-redux babeljs


    【解决方案1】:

    解决这个问题的简单方法是:

    import * as actionCreators from './actions/loginAction'
    export {actionCreators}
    

    【讨论】:

      【解决方案2】:

      我想你是用export代替import,用import替换export再检查

      【讨论】:

      • 请更具体或添加代码示例。
      猜你喜欢
      • 1970-01-01
      • 2021-03-09
      • 1970-01-01
      • 1970-01-01
      • 2019-06-24
      • 2022-01-24
      • 1970-01-01
      • 1970-01-01
      • 2020-11-29
      相关资源
      最近更新 更多