Skip to content

Commit

Permalink
fix(react): 修复 preact 地图组件 onRegionChange 事件报错的问题,fix #11462
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj committed Jun 30, 2022
1 parent c4124e4 commit b42b656
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/taro-plugin-react/src/runtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ if (__TARO_FRAMEWORK__ === 'preact') {
i = i.toLowerCase()
}

if (type === 'map' && i === 'onregionchange') {
// map 组件的 regionchange 事件非常特殊,详情:https://github.com/NervJS/taro/issues/5766
normalizedProps.onbegin = value
normalizedProps.onend = value
continue
}

normalizedProps[i] = value
}

Expand Down

0 comments on commit b42b656

Please sign in to comment.