Skip to content

New Architecture Enabled fix for getLastKnownLocation iOS method and Fixing cloneReactChildrenWithProps in Javascript Module#3923

Merged
mfazekas merged 1 commit into
rnmapbox:mainfrom
whiteHatCip:new-arch/get-last-known-location
Aug 11, 2025
Merged

New Architecture Enabled fix for getLastKnownLocation iOS method and Fixing cloneReactChildrenWithProps in Javascript Module#3923
mfazekas merged 1 commit into
rnmapbox:mainfrom
whiteHatCip:new-arch/get-last-known-location

Conversation

@whiteHatCip

Copy link
Copy Markdown
Contributor

Fixing the cloneReactChildrenWithProps method to handle those cases where the children property contains a child which is a React.Fragment, for which no prop can be added.

getLastKnownLocation for when New Architecture is enabled now returns an optional [String:Any]? value, which is compliant with Objective-C, in place of the RNMBXLocation type. This change is needed for the javascript invocation to actually work, when building the app with New Architecture enabled.

toJSON iOS method for builds with New Architecture enabled always returns a [String:Any] dictionary, hence there is no need for the dictionary value type to be Any?

Description

Fixes an issue that prevented the proper retrieval of last known location when using New Architecture on iOS. In addition to that, another fix has been implemented to make sure that the cloneReactChildrenWithProps method handles properly those cases where the children property contains a child which is a React.Fragment, for which no prop can be added, and therefore should not be added, otherwise a crash would happen.

Checklist

  • I've read CONTRIBUTING.md
  • I updated the doc/other generated code with running yarn generate in the root folder
  • I have tested the new feature on /example app.
    • In V11 mode/ios
    • In New Architecture mode/ios
    • In V11 mode/android
    • In New Architecture mode/android
  • I added/updated a sample - if a new feature was implemented (/example)

Component to reproduce the issue you're fixing

Since it's just a few lines change, thanks to which my app is not crashing anymore, I am omitting the test component in this description.

…here the children property contains a child which is a React.Fragment, for which no prop can be added.

toJSON method always returns a [String:Any] dictionary, hence there is no need to have the value type to be "Any?"

getLastKnownLocation now returns an optional [String:Any] value, which is compliant with objective-c, in place of the RNMBXLocation type.
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens August 10, 2025 21:46 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens August 10, 2025 21:46 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens August 10, 2025 21:46 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens August 10, 2025 21:46 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens August 10, 2025 21:46 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens August 10, 2025 21:46 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens August 10, 2025 21:46 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip mentioned this pull request Aug 10, 2025
@mfazekas mfazekas merged commit 1fb5574 into rnmapbox:main Aug 11, 2025
11 checks passed
@whiteHatCip whiteHatCip deleted the new-arch/get-last-known-location branch August 13, 2025 22:22
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

Successfully merging this pull request may close these issues.

2 participants