Skip to content

react-router-dom 6.1.1 에서 안되는 거 같음 #4

Description

@min9nim

CRA5.0 에서 사용할 때 아래와 같은 이상한 오류가 발생함.

버젼 차이 문제 같으음..;

A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.
error-component-stack

    at Route (http://localhost:3000/static/js/bundle.js:242325:11)
    at DynamicRoute
    at Routes (http://localhost:3000/static/js/bundle.js:14559:82)
    at DndProvider (http://localhost:3000/static/js/bundle.js:259978:5)
    at QueryClientProvider (http://localhost:3000/static/js/bundle.js:238549:21)
    at Suspense
    at NavigationScroll (http://localhost:3000/static/js/bundle.js:8601:5)
    at InnerThemeProvider (http://localhost:3000/static/js/bundle.js:55808:70)
    at ThemeProvider (http://localhost:3000/static/js/bundle.js:55465:5)
    at ThemeProvider (http://localhost:3000/static/js/bundle.js:55828:5)
    at ErrorBoundary (http://localhost:3000/static/js/bundle.js:836:5)
    at StyledEngineProvider (http://localhost:3000/static/js/bundle.js:55654:5)
    at App (http://localhost:3000/static/js/bundle.js:538:81)
    at Router (http://localhost:3000/static/js/bundle.js:242340:15)
    at BrowserRouter (http://localhost:3000/static/js/bundle.js:241819:5)
    at Provider (http://localhost:3000/static/js/bundle.js:239256:20)

CRA5.0 의 package.json

        "react": "^18.1.0",
        "react-apexcharts": "^1.3.7",
        "react-datepicker": "^4.8.0",
        "react-device-detect": "^1.17.0",
        "react-dnd": "^16.0.1",
        "react-dnd-html5-backend": "^16.0.1",
        "react-dom": "^18.1.0",
        "react-dynamic-route": "^0.1.2",
        "react-hot-loading": "^0.0.2",
        "react-hot-toast": "^2.2.0",
        "react-perfect-scrollbar": "^1.5.8",
        "react-query": "^3.34.5",
        "react-redux": "^7.2.3",
        "react-router": "6.1.1",
        "react-router-dom": "6.1.1",
        "react-scripts": "5.0.1",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions