8000 Make RNMBXCameraComponentView prop conversions type-safe by adding Dynamic suffix and explicit unwrapping by whiteHatCip · Pull Request #3850 · rnmapbox/maps · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make RNMBXCameraComponentView prop conversions type-safe by adding Dynamic suffix and explicit unwrapping #3850

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

Merged
merged 1 commit into from
May 26, 2025

Conversation

whiteHatCip
Copy link
Contributor
@whiteHatCip whiteHatCip commented May 1, 2025

Description

Summary

This PR makes the followUserLocation React-prop-to-native assignment in RNMBXCameraComponentView.mm fully type-safe and self-documenting by:

  • Unwrapping the bool primitive value with the appropriate accessor:
    • boolValue for boolean props

Problem

  • Implicit assignments of raw id (e.g. assigning an NSNumber* directly to a BOOL, or an NSString* to an NSString*) can lead to silent failures, unpredictable defaults, or crashes if the JS payload doesn’t exactly match the expected type.

Fixes #3794

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)

…w.mm

- Append `Dynamic` suffix to local variables from `RNMBXConvertFollyDynamicToId`
- Replace raw `id` assignments with explicit unwrapping:
  - `[... boolValue]` for boolean props
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens May 3, 2025 18:41 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens May 3, 2025 18:41 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens May 3, 2025 18:41 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens May 3, 2025 18:41 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens May 3, 2025 18:41 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens May 3, 2025 18:41 — with GitHub Actions Inactive
@whiteHatCip whiteHatCip temporarily deployed to CI with Mapbox Tokens May 3, 2025 18:41 — with GitHub Actions Inactive
@mfazekas mfazekas merged commit 940c67b into rnmapbox:main May 26, 2025
11 checks passed
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.

[Bug]: followUserLocation cannot be turned off
2 participants
0