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

3.5.5版本不支持WebView组件;入口文件处不支持使用onAppShow #12462

Closed
zhuwenqi001 opened this issue Sep 8, 2022 · 3 comments
Closed
Labels
E-easy Helper Wanted - Easy F-react Framework - React T-feishu V-3 Version - 3.x

Comments

@zhuwenqi001
Copy link

相关平台

飞书小程序

复现仓库

https://github.com/zhuwenqi001/taro3.5.5_test

使用框架: React

复现步骤

  1. pnpm i
  2. pnpm run dev
  3. 使用飞书开发者工具打开dist

期望结果

  1. 正常使用import { WebView } from '@tarojs/components';
    首页应该展示webview -- 百度网页信息

  2. 入口文件app.ts中调用onAppShow生效,控制台需打印 app onAppShow

实际结果

  1. 未定义的模板 (tmpl_0_46) in base
  2. 未进入 onAppShow 回调函数

环境信息

👽 Taro v3.5.5


  Taro CLI 3.5.5 environment info:
    System:
      OS: macOS 12.4
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
      Yarn: 1.22.19 - ~/.nvm/versions/node/v16.17.0/bin/yarn
      npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.5.5 => 3.5.5 
      @tarojs/components: 3.5.5 => 3.5.5 
      @tarojs/helper: 3.5.5 => 3.5.5 
      @tarojs/plugin-framework-react: 3.5.5 => 3.5.5 
      @tarojs/plugin-html: 3.5.5 => 3.5.5 
      @tarojs/plugin-platform-alipay: 3.5.5 => 3.5.5 
      @tarojs/plugin-platform-jd: 3.5.5 => 3.5.5 
      @tarojs/plugin-platform-qq: 3.5.5 => 3.5.5 
      @tarojs/plugin-platform-swan: 3.5.5 => 3.5.5 
      @tarojs/plugin-platform-tt: 3.5.5 => 3.5.5 
      @tarojs/plugin-platform-weapp: 3.5.5 => 3.5.5 
      @tarojs/react: 3.5.5 => 3.5.5 
      @tarojs/router: 3.5.5 => 3.5.5 
      @tarojs/runtime: 3.5.5 => 3.5.5 
      @tarojs/shared: 3.5.5 => 3.5.5 
      @tarojs/taro: 3.5.5 => 3.5.5 
      @tarojs/taro-h5: 3.5.5 => 3.5.5 
      @tarojs/webpack5-runner: 3.5.5 => 3.5.5 
      babel-preset-taro: 3.5.5 => 3.5.5 
      eslint-config-taro: 3.5.5 => 3.5.5 
      react: ^18.0.0 => 18.2.0 
@Chen-jj
Copy link
Contributor

Chen-jj commented Sep 19, 2022

@zhuwenqi001 飞书小程序插件暂未支持 Taro v3.5+,可以使用 Taro 3.4 或以下版本先绕过

@Chen-jj
Copy link
Contributor

Chen-jj commented Jan 17, 2023

问题一 duplicate #12950 ,待飞书小程序插件的同学修复。

@Chen-jj
Copy link
Contributor

Chen-jj commented Jan 17, 2023

问题二,是支持 Taro.onAppShow 的,但因为React18异步渲染的原因,它监听不了首次 onShow。同时建议放 onLaunch 里,否则每次 React 每次 render 都会增加一次监听:

useLaunch((res) => {
  Taro.onAppShow((res) => {
    console.log('app onAppShow');
  });
})

image

@Chen-jj Chen-jj closed this as completed Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Helper Wanted - Easy F-react Framework - React T-feishu V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants