Taro: 【H5】"export 'useSelector' was not found in '@tarojs/redux-h5'

Created on 17 Jun 2019  ·  19Comments  ·  Source: NervJS/taro

问题描述
[问题描述:站在其它人的角度尽可能清晰地、简洁地把问题描述清楚]

h5, 未导出useSelector

复现步骤
[复现问题的步骤]

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

期望行为
[这里请用简洁清晰的语言描述你期望的行为]

报错信息
1560740460054

系统信息

Taro CLI 1.3.1 environment info:
    System:
      OS: macOS 10.14
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.15.1 - ~/.nvm/versions/node/v10.15.1/bin/node
      Yarn: 1.13.0 - /usr/local/bin/yarn
      npm: 6.4.1 - ~/.config/yarn/global/node_modules/.bin/npm
    npmPackages:
      @tarojs/async-await: ^1.3.1 => 1.3.1 
      @tarojs/cli: ^1.3.1 => 1.3.1 
      @tarojs/components: 1.3.1 => 1.3.1 
      @tarojs/plugin-babel: 1.3.1 => 1.3.1 
      @tarojs/plugin-csso: 1.3.1 => 1.3.1 
      @tarojs/plugin-sass: 1.3.1 => 1.3.1 
      @tarojs/plugin-uglifyjs: 1.3.1 => 1.3.1 
      @tarojs/redux: ^1.3.1 => 1.3.1 
      @tarojs/redux-h5: ^1.3.1 => 1.3.1 
      @tarojs/rn-runner: 1.3.1 => 1.3.1 
      @tarojs/router: 1.3.1 => 1.3.1 
      @tarojs/taro: ^1.3.1 => 1.3.1 
      @tarojs/taro-alipay: 1.3.1 => 1.3.1 
      @tarojs/taro-h5: 1.3.1 => 1.3.1 
      @tarojs/taro-swan: 1.3.1 => 1.3.1 
      @tarojs/taro-tt: 1.3.1 => 1.3.1 
      @tarojs/taro-weapp: 1.3.1 => 1.3.1 
      @tarojs/webpack-runner: 1.3.1 => 1.3.1 
      eslint-config-taro: 1.3.1 => 1.3.1 
      eslint-plugin-taro: 1.3.1 => 1.3.1 
      nerv-devtools: ^1.4.0 => 1.4.0 
      nervjs: ^1.4.0 => 1.4.0

补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]

Most helpful comment

能快点支持么?或者提供贡献支持,公司之前小程序用taro做,全部用的useSelector,结果现在要转到h5说不支持,那好歹要在文档上有体现啊-。-

All 19 comments

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

更新 nerv-redux 到 1.4.1

更新 nerv-redux 到 1.4.1

请问怎么更新? 更新nervjs后依然报错

    1.
cd node_modules/@tarojs/redux-h5
npm i nerv-redux@latest
  1. 把 node_modules 和各种 lock 清空重装也应该可以。

Hello~

您的问题楼上已经提供了解决方案,如果没有更多的问题这个 issue 将在 15 天后被自动关闭。

如果您在这 15 天中更新更多信息自动关闭的流程会自动取消,如有其他问题也可以发起新的 Issue。

Good luck and happy coding~

安装nerv-redux可以吗???
打包出来的也没有依赖nerv-redux啊
@yuche 是不是得更新redux-h5/react-redux

taro redux 需要在 h5 对路由做一些特殊处理,不能直接引用 nerv-redux。因此 useSelector 等 API 可能会迟点在 h5 实现。

CC @Littly

能快点支持么?或者提供贡献支持,公司之前小程序用taro做,全部用的useSelector,结果现在要转到h5说不支持,那好歹要在文档上有体现啊-。-

请问有什么进度更新或者临时workaround吗?

h5大概还要多久支持useSelector?

真是好大的坑,幸好暂时不需要h5

走坑+1

等到脖子都长了

useDispatch , useSelector 这2个api在H5啥时候才能实现啊亲

之前大力推广了一波函数式组件,结果h5 不支持,有点尴尬啊。公司突然要做h5版的,一跑起来这样...

可以参考我的解决办法。
https://github.com/NervJS/taro/issues/4981

这个问题,现在有解决没?

Taro 3 能直接使用 redux,应该没有这个问题了

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fxy5869571 picture fxy5869571  ·  3Comments

LadyChatterleyLover picture LadyChatterleyLover  ·  3Comments

aiewing picture aiewing  ·  3Comments

GreatAuk picture GreatAuk  ·  3Comments

ruixiu picture ruixiu  ·  3Comments