Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

this.getNativeComponent undefined error and Cannot read property ‘bubblingEventTypes’ of null tell you how to fix in Fabric

未关闭
#5,520 8 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
react-native, typescript
领域
mobile-dev

调研方向

Start by reproducing the iOS Google Maps case with React Native 0.76.0 and react-native-maps 1.23.8 using the MapView sample. Inspect src/MapMarker.tsx and the provider-related MapView usage, then verify the reported errors are resolved without editing node_modules directly.

由索引模型根据 Issue 内容生成。

描述

bug
Summary

I meet the problem about this.getNativeComponent undefined error and ‘bubblingEventTypes’ of null when i use RN/0.76.0 and react-native-maps v1.23.8, it take me long time to fix, i will share how to fix them here now!

Reproducible sample code
<MapView
                ref={mapRef}
                mapType={'standard'}
                zoomControlEnabled={true}
                style={{ ...StyleSheet.absoluteFillObject }}
                // provider={PROVIDER_GOOGLE}
                initialRegion={{
                  latitude,
                  longitude,
                  latitudeDelta: delta,
                  longitudeDelta: delta,
                }}
              >
Steps to reproduce

RN/0.76.0
react-native-maps v1.23.8

Expected result

First, you will meet the problem ‘bubblingEventTypes’ of null.
You only to deleted provider in
<MapView
ref={mapRef}
mapType={'standard'}
zoomControlEnabled={true}
style={{ ...StyleSheet.absoluteFillObject }}
// provider={PROVIDER_GOOGLE}
initialRegion={{
latitude,
longitude,
latitudeDelta: delta,
longitudeDelta: delta,
}}
>

Second, you will meet the problem this.getNativeComponent undefined error.
Go to the file node_modules/react-native-maps/src/MapMarker.tsx
// getNativeComponent!: () => NativeComponent; //deleted

That it all, you will work fine!

Actual result

if you have any other problem you can tell me.

React Native Maps Version

1.23.8

What platforms are you seeing the problem on?

iOS (Google Maps)

React Native Version

0.76.0

What version of Expo are you using?

Not using Expo

Device(s)

iphone 16

Additional information

No response

主要语言
TypeScript
星标
16k
派生
5k
平均合并
17 小时 45 分钟
30 天内合并 PR
2

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

react-native-maps/react-native-maps 的其他 Issue

查看 react-native-maps/react-native-maps 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。