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

在微信小程序中Text移除事件时报错 #16012

Open
liulinboyi opened this issue Jun 29, 2024 · 0 comments
Open

在微信小程序中Text移除事件时报错 #16012

liulinboyi opened this issue Jun 29, 2024 · 0 comments

Comments

@liulinboyi
Copy link

相关平台

微信小程序

小程序基础库: 2.25.3

使用框架: React

重现项目

https://github.com/liulinboyi/taro-removeEventListener-bug

复现步骤

点击项目中Demo 1时会移除Text事件,此时会报错
demo_bug

代码

import { View, Text } from '@tarojs/components'
import { useState } from 'react'

export default function Index() {
  const [flag, setFlag] = useState(true)

  return (
    <View className='index'>
      <View className='wrapper'>
        {
          flag ?
            <Text className='box' onClick={() => setFlag(prev => !prev)}>Demo {flag ? '1' : '0'}</Text> :
            <Text className='box'>Other {flag ? '1' : '0'}</Text>
        }
      </View>
    </View>
  )
}

期望结果

在微信小程序中Text移除事件时不报错

实际结果

在微信小程序中Text移除事件时报错

环境信息

👽 Taro v3.6.32


  Taro CLI 3.6.32 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 18.16.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
      npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.32 => 3.6.32 
      @tarojs/components: 3.6.32 => 3.6.32 
      @tarojs/helper: 3.6.32 => 3.6.32 
      @tarojs/plugin-framework-react: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-alipay: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-h5: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-jd: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-qq: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-swan: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-tt: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-weapp: 3.6.32 => 3.6.32 
      @tarojs/react: 3.6.32 => 3.6.32 
      @tarojs/runtime: 3.6.32 => 3.6.32 
      @tarojs/shared: 3.6.32 => 3.6.32 
      @tarojs/taro: 3.6.32 => 3.6.32 
      @tarojs/taro-loader: 3.6.32 => 3.6.32 
      @tarojs/webpack5-runner: 3.6.32 => 3.6.32 
      babel-preset-taro: 3.6.32 => 3.6.32 
      eslint-config-taro: 3.6.32 => 3.6.32 
      react: ^18.0.0 => 18.3.1 
This was referenced Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant