Skip to content

Conversation

qja0707
Copy link
Contributor

@qja0707 qja0707 commented Jul 9, 2025

Type of change

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhance (enhance performance, api, etc)
  • Chore
  • This change requires a documentation update
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

What does this change?

🇰🇷 한국어

React Native New Architecture에서 네이티브 지도 컴포넌트(RNCNaverMapView)의 스펙을 정의하는 코드젠용 spec 파일인 `src/spec/RNCNaverMapViewNativeComponent.ts' 에서 props 타입을 boolean 으로만 정의하게 되면 해당 props 의 기본값이 c++ 의 기본형에 따라 false 로 지정됩니다.

지도 첫 렌더 시 몇몇 props 에 false 로 설정하면 앞에서 c++에 설정된 기본값과 같아 실제 sdk 에 false 로 설정하지 않습니다.

// RNCNaverMapView.mm
...
if (prev.isShowCompass != next.isShowCompass)
    [_view setShowCompass:next.isShowCompass];
...

그러나 sdk 의 기본 값은 true 이기 때문에 props 가 반영되지 않는 것 처럼 보이는 버그를 수정합니다.

English In the codegen spec file src/spec/RNCNaverMapViewNativeComponent.ts, which defines the spec for the native map component (RNCNaverMapView) in React Native New Architecture, if a prop is defined as a boolean type, its default value is set to false according to the C++ primitive type default. When the map is first rendered, if some props are set to false, this matches the default value in C++, so the value is not actually set in the underlying SDK.
// RNCNaverMapView.mm
...
if (prev.isShowCompass != next.isShowCompass)
    [_view setShowCompass:next.isShowCompass];
...

However, since the SDK’s default value is true, this causes a bug where the prop appears not to be applied.

See also: #130 (comment)

- Changed prop types of isShowCompass, isShowScaleBar, isShowZoomControls to WithDefault<boolean, true>
- Ensures default value is true, matching the SDK's default behavior
- See: https://navermaps.github.io/ios-map-sdk/reference/Classes/NMFNaverMapView.html
@mym0404 mym0404 merged commit 98dfe39 into mym0404:main Jul 12, 2025
3 checks passed
@qja0707 qja0707 deleted the fix/map-view-props/fix-default-boolean-value branch September 8, 2025 01:06
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