인프런 커뮤니티 질문&답변
npm run start 오류
작성
·
253
답변 1
0
John Ahn
지식공유자
안녕하세요 suminei님!
index.js에
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import {
BrowserRouter as Router,
} from "react-router-dom";
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<Router>
<App />
</Router>
</React.StrictMode>
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
이런 식으로 만들어주실래요?!!
<BrowserRouter> 로 감싸주지 않아서 나왔던 에러였습니다 ㅎㅎ
수고하세요!
여기 참조 문서입니다.
https://reactrouter.com/docs/en/v6/routers/browser-router





해결되었습니다! 알려주셔서 감사합니다ㅠㅠ