안녕하세요. quickstart 관련 질문드립니다. #104
Answered
by
zeakd
ehd1120gus
asked this question in
Q&A
-
import { NaverMapsProvider } from 'react-naver-maps';
function App() {
return (
<NaverMapsProvider
ncpClientId='MY_NAVERMAPS_CLIENT_ID'
// or finClientId, govClientId
>
<TheRestOfYourApplication />
</NaverMapsProvider>
)
}
import { NavermapsProvider, Container as Mapdiv, NaverMap, Marker, useNavermaps } from 'react-naver-maps';
function App() {
return (
<NavermapsProvider
ncpClientId ='ehd1120gus's Client ID'
// or finClientId, govClientId
>
<Mapdiv
style={{
width: '100%',
height: '600px',
}}
>
<MyMap />
</Mapdiv>
</NavermapsProvider>
)
}
function MyMap() {
// instead of window.naver.maps
const navermaps = useNavermaps()
return (
<NaverMap
defaultCenter={new navermaps.LatLng(37.3595704, 127.105399)}
defaultZoom={15}
>
<Marker
defaultPosition={new navermaps.LatLng(37.3595704, 127.105399)}
/>
</NaverMap>
)
}
export default App; 실행 후 chrome 화면은 하얗게 나오고, 로그에는 [Uncaught Error: react-naver-maps: MapDiv is not found. Did you correctly wrap with 읽어주셔서 감사합니다. 답변 기다리겠습니다. |
Beta Was this translation helpful? Give feedback.
Answered by
zeakd
Mar 14, 2023
Replies: 2 comments 3 replies
-
제 에디터에서 export default App; 가 비활성화되어 no usage라고 합니다. |
Beta Was this translation helpful? Give feedback.
0 replies
-
앗 동현님 제가 재현가능할 수 있도록 github repository를 생성하여 공유 부탁드린다는 말씀이었는데요. create react app 에서 App.js만 고친 상황일까요? |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
zeakd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
앗 동현님 제가 재현가능할 수 있도록 github repository를 생성하여 공유 부탁드린다는 말씀이었는데요. create react app 에서 App.js만 고친 상황일까요?