Repository navigation
Conversation
4 of 8 tasks
… when unset Unsetting these props makes Fabric send null, which crashed in DynamicFromObject.asX(). Each setter now treats null as unset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gadcam
force-pushed
the
fix/android-null-layer-mapview-props
branch
from
November 23, 2026 18:47
82f3f15 to
a4737a0
Compare
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #4451 / #4454. On Android, when a prop goes from defined to
undefined, Fabric sendsnullto the@ReactPropsetter, andDynamic.asInt/asDouble/asString/asMap/asArray/asBoolean()throwClassCastExceptionon null. This crashes the app. This PR makes every reproduced, user-reachable case null-safe.Methodology
@ReactPropsetter that takes aDynamicand callsasX()with noisNull/ type guard. It follows helpers and flags deadasMap() == nullchecks. It then cross-checks the JS wrapper to see if the prop can actually reach native asnull. Onmainit found 273 setters, 163 unguarded and 119 that can receive null.DynamicFromObjectlogcat lines after it.Fixed (crash before → OK after)
yarn generate)minZoomLevel,maxZoomLevellayerIndexstyleprojectionzoomEnabledtrue(Mapbox default)preferredFramesPerSecondscaleBarUnitsattributionPosition,logoPosition,scaleBarPosition,compassPosition,compassViewMargins== nullchecks removed)compassViewPositionfollowPaddingtileSizesourceBoundstileSizehitboxRNMBXSource.setHitbox(ReadableMap?)from #4454)urlshapeprop provides the dataAlso removed the unused
import com.rnmapbox.rnmbx.v11compat.layer.*fromRNMBXLayer.kt. That package is empty, so the import failed to compile as soon as the file was recompiled.Not changed
MapView.styleURL(always defaulted),MarkerView.allowOverlap(destructuring default),CustomLocationProvider.heading,Images.id,sourceID,existing.Checklist
CONTRIBUTING.mdyarn generatein the root folder/exampleapp./example)Component to reproduce (BugReportExample.js): each button unsets one prop
🤖 Generated with Claude Code