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

使用 react.useHtmlComponents = true 并且使用了tarojs/components-react 包但是tabbar无法正确渲染 #9223

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

Comments

@ds147000
Copy link

ds147000 commented Apr 28, 2021

相关平台

H5

浏览器版本: 谷歌最新版
使用框架: React

复现步骤

taro-components-react 组件包根据文档从taro2.x把tabbar模块搬进去的,然后build也没有问题。但是在跑h5时候发现tabbar没有被渲染成组件

//@tarojs/components-react/index.js
...code
export { default as Tabbar } from './dist/tabbar/index'
export { default as TabbarContainer } from './dist/tabbar/container'
export { default as TabbarPanel } from './dist/tabbar/panel'
...code

components-react组件编译结果存在tabbar
image

页面内容有正确渲染,只是tabbar没有。帮忙看一下是否是tabbar导出错误了
image

期望结果

正确渲染tabbar节点

实际结果

没有渲染tabbar节点内容

环境信息

  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.6 => 3.2.6 
      @tarojs/mini-runner: 3.2.6 => 3.2.6 
      @tarojs/react: 3.2.6 => 3.2.6 
      @tarojs/runtime: 3.2.6 => 3.2.6 
      @tarojs/taro: 3.2.6 => 3.2.6 
      @tarojs/webpack-runner: 3.2.6 => 3.2.6 
      babel-preset-taro: 3.2.6 => 3.2.6 
      eslint-config-taro: 3.2.6 => 3.2.6 
      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 28, 2021
@luckyadam
Copy link
Member

@tarojs/components-react 没有包含 tabbar 这个组件

@ds147000
Copy link
Author

@tarojs/components-react 没有包含 tabbar 这个组件

那tabbar组件在哪个组件包实现

@ds147000
Copy link
Author

@tarojs/components-react 没有包含 tabbar 这个组件

顺带问一下,H5 router 入口文件在哪个组件包,因为要做自定义的ssr渲染,所以我需要找到入口包修改H5的渲染模式为hydrated。谢谢

@luckyadam
Copy link
Member

在 @tarojs/components 里

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