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

Taro3.4.3版本Preact导致Map组件的 onRegionChange 事件失效报错 #11462

Closed
dibaosong opened this issue Mar 17, 2022 · 1 comment · Fixed by #12014
Closed

Taro3.4.3版本Preact导致Map组件的 onRegionChange 事件失效报错 #11462

dibaosong opened this issue Mar 17, 2022 · 1 comment · Fixed by #12014
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Milestone

Comments

@dibaosong
Copy link

相关平台

微信小程序

小程序基础库: 2.23.0
使用框架: React

复现步骤

import { Component } from 'react'
import Taro from '@tarojs/taro';
import { View, Text, Map } from '@tarojs/components'
import { AtButton } from 'taro-ui'

import "taro-ui/dist/style/components/button.scss" // 按需引入
import './index.scss'

interface IProps {

}

interface IState {
  latitude: number;
  longitude: number;
}

export default class Index extends Component <IProps, IState> {

  constructor(props) {
    super(props);
    this.state = {
      latitude: 39.72684,
      longitude: 116.34159
    };
  }

  componentWillMount () { }

  componentDidMount () { }

  componentWillUnmount () { }

  componentDidShow () { }

  componentDidHide () { }


  onRegionChange = (e) => {
    console.log(e)
  }

  render () {
    const { latitude, longitude } = this.state;
    return (
      <View className='index'>
        <Map
            id='myMap'
            scale={16}
            longitude={longitude}
            latitude={latitude}
            enableScroll={true}
            onRegionChange={this.onRegionChange}
            style="width: 100%; height: 500px;">
        </Map>
      </View>
    )
  }
}

期望结果

Map组件的onRegionChange事件正常使用

实际结果

VM244 WAService.js:2 TypeError: this.l[(n.type false)] is not a function
报错导致onRegionChange不能正常工作

环境信息

Taro CLI 3.4.3 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 14.10.0 - ~/.nvm/versions/node/v14.10.0/bin/node
      Yarn: 1.22.17 - ~/.nvm/versions/node/v14.10.0/bin/yarn
      npm: 6.14.8 - ~/.nvm/versions/node/v14.10.0/bin/npm
    npmPackages:
      @tarojs/cli: 3.4.3 => 3.4.3 
      @tarojs/components: 3.4.3 => 3.4.3 
      @tarojs/mini-runner: 3.4.3 => 3.4.3 
      @tarojs/runtime: 3.4.3 => 3.4.3 
      @tarojs/taro: 3.4.3 => 3.4.3 
      @tarojs/webpack-runner: 3.4.3 => 3.4.3 
      babel-preset-taro: 3.4.3 => 3.4.3 
      eslint-config-taro: 3.4.3 => 3.4.3 
      taro-ui: ^3.0.0-alpha.3 => 3.0.0-alpha.10
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Mar 17, 2022
@github-actions
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants