Home > Software engineering >  ./src/App.jsx Attempted import error: 'Routes' is not exported from 'react-router-dom
./src/App.jsx Attempted import error: 'Routes' is not exported from 'react-router-dom

Time:04-21

Por favor ayuda con el siguiente error en React

{ "name": "login-react-1", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^5.16.3", "@testing-library/react": "^12.1.4", "@testing-library/user-event": "^13.5.0", "firebase": "^8.7.1", "react": "^18.0.0", "react-dom": "^18.0.0", "react-router": "^5.3.1", "react-router-dom": "^5.3.1", "react-scripts": "^2.1.3", "web-vitals": "^2.1.4" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }

CodePudding user response:

You're trying to import "Routes" instead of "Route":

import {
  Route,
} from "react-router-dom";

https://v5.reactrouter.com/web/guides/quick-start

CodePudding user response:

"react-router-dom"' has no exported member named 'Routes'. Did you mean 'Route'?

  • Related