marker.d.ts 에러 문제
import {LatLng, MapMarkerProps} from 'react-native-maps';
// marker props의 타입을 변경
declare module 'react-native-maps' {
export interface MyMapMarkerProps extends MapMarkerProps {
coordinate?: LatLng;
}
}
Interface 'MyMapMarkerProps' incorrectly extends interface 'MapMarkerProps'.
Type 'MyMapMarkerProps' is not assignable to type '{ anchor?: Point | undefined; calloutAnchor?: Point | undefined; calloutOffset?: Point | undefined; centerOffset?: Point | undefined; coordinate: LatLng; ... 22 more ...; zIndex?: number | undefined; }'.
Types of property 'coordinate' are incompatible.
Type 'LatLng | undefined' is not assignable to type 'LatLng'.
Type 'undefined' is not assignable to type 'LatLng'.ts(2430)
이런 에러가 발생합니다. 강의와 동일하게 했는데 그렇습니다! 아래 질문주신분 답변에 응답이 없어서 다시 질문드리는 점 양해부탁드립니다!
답변 1
0
Omit을 이용해서 coordinate를 제외한 뒤에 추가해보시겠어요?
import {LatLng, MapMarkerProps} from 'react-native-maps';
declare module 'react-native-maps' {
export interface MyMapMarkerProps extends Omit<MapMarkerProps, 'coordinate'> {
coordinate?: LatLng;
}
}
그리고 코드를 올리실때는 이렇게 코드블럭이나 깃헙을 활용해주세요!
react-native-screens 버전 호환 문제
2
153
1
안드로이드 실행 중 Drawer네비게이션과 MapView 성능 문제
0
103
2
해당 강의 부분은 실제 활용하기에 부족해 제가 해결한 방법입니다.
0
96
1
소스코드가 강의 순서랑 다른가요?
0
72
2
현재 Windows에서 VsCode로 작업 중인데 추후에 IOS도 가능하게 하려면
0
115
2
react-native-fast-image는 react 19 버전에서 설치가 안되나요?
0
208
2
SQL Shell의 역할이 무엇인가요?
0
91
1
혹시 해당 강의에서invalidateQueries를 사용한 이유가 있을까요?
0
79
2
빠르게 실행해보고싶습니다.
0
82
1
강의 수강 순서 관련
0
70
1
애뮬레이터 실행 방법
0
99
2
무료 Apple ID로 실기기 테스트 가능한가요?
0
90
2
ios 실기기 연결
0
70
2
npm run ios에러
0
74
1
10월 삭제 예정인 강의는 이유를 알 수 있을까요?
0
101
1
캘린더 개발 후에 navigation 에 대해서 궁금한 점이 있습니다.
0
51
1
안드로이드 위치 권한 이슈 2가지 문의
0
71
1
지도가 보이려면 음.. 작성해주신 스타일과 다르게
0
74
0
제대로 설치한거같은데 안드로이드랑 ios 둘다 앱실행이 안되는것같아요
0
83
3
강의 내용을 보면 전체적으로 function 함수 키워드를 사용하시는데
0
69
2
강의 3-9 에서 useGetRefreshToken 훅 안에 즉시 함수로 처리하는 이유가 궁금합니다!
0
82
2
사내에서 figma.com 업로드 안되나요?
0
96
1
AWS EC2 + RDS 설정
0
85
2
안드로이드 안켜집니다.
0
91
2





