Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H5.useHtmlComponents = true 不生效, 没有使用@taro/components-react #9209

Closed
ds147000 opened this issue Apr 27, 2021 · 2 comments
Closed
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x

Comments

@ds147000
Copy link

相关平台

H5

浏览器版本: 谷歌 版本 90.0.4430.85(正式版本) (arm64)
使用框架: React

复现步骤

配置文件

// config/index.js
  h5: {

    useHtmlComponents: true, // 使用react 编译组件
}

package.json 内容

"dependencies": {
    "@babel/runtime": "^7.7.7",
    "@rematch/core": "^2.0.1",
    "@tarojs/components": "3.2.0",
    "@tarojs/components-react": "^3.2.6",
    "@tarojs/react": "3.2.0",
    "@tarojs/runtime": "3.2.0",
    "@tarojs/taro": "3.2.0",
    "deepmerge": "^4.2.2",
    "react": "^17.0.0",
    "react-dom": "^17.0.0",
    "react-redux": "^7.2.3",
    "redux": "^4.0.5"
  },

1.我把@taro/components-react 的组件做了其他组件的react化和部分修改,并且发布到了公司内部的npm。
2.启动程序h5开发,发现并没有使用@taro/components-react作为组件提供,而是继续沿用@taro/components ....因为我们公司使用midway做ssr,所以需要把Stencil实现的组件还原到taro2.x进行服务端渲染

期望结果

H5.useHtmlComponents 应该生效使用@taro/components-react

实际结果

H5.useHtmlComponents = true 没有使用@taro/components-react

环境信息

👽 Taro v3.2.0


  Taro CLI 3.2.0 environment info:
    System:
      OS: macOS 11.2.3
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 15.12.0 - /opt/homebrew/bin/node
      Yarn: 1.22.10 - /opt/homebrew/bin/yarn
      npm: 7.6.3 - /opt/homebrew/bin/npm
    npmPackages:
      @tarojs/components: 3.2.0 => 3.2.0 
      @tarojs/mini-runner: 3.2.0 => 3.2.0 
      @tarojs/react: 3.2.0 => 3.2.0 
      @tarojs/runtime: 3.2.0 => 3.2.0 
      @tarojs/taro: 3.2.0 => 3.2.0 
      @tarojs/webpack-runner: 3.2.0 => 3.2.0 
      babel-preset-taro: 3.2.0 => 3.2.0 
      eslint-config-taro: 3.2.0 => 3.2.0 
      react: ^17.0.0 => 17.0.2 
    npmGlobalPackages:
      typescript: 4.3.0-dev.20210406
@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Apr 27, 2021
@luckyadam
Copy link
Member

taro 版本比较旧,升级到最新版本吧

@ds147000
Copy link
Author

taro 版本比较旧,升级到最新版本吧

好的,3.2.0 可以吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

No branches or pull requests

2 participants