adrianhajdin / project_google_clone

Google Clone App powered by RapidAPI
455 stars 127 forks source link

Router problem #3

Open DucTRV opened 2 years ago

DucTRV commented 2 years ago

Compiled with problems:X

ERROR in ./src/components/Routes.jsx 10:33-39

export 'Switch' (imported as 'Switch') was not found in 'react-router-dom' (possible exports: BrowserRouter, HashRouter, Link, MemoryRouter, NavLink, Navigate, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createRoutesFromChildren, createSearchParams, generatePath, matchPath, matchRoutes, renderMatches, resolvePath, unstable_HistoryRouter, useHref, useInRouterContext, useLinkClickHandler, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams)

decozzfx commented 2 years ago

Compiled with problems:X

ERROR in ./src/components/Routes.jsx 10:33-39

export 'Switch' (imported as 'Switch') was not found in 'react-router-dom' (possible exports: BrowserRouter, HashRouter, Link, MemoryRouter, NavLink, Navigate, Outlet, Route, Router, Routes, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, createRoutesFromChildren, createSearchParams, generatePath, matchPath, matchRoutes, renderMatches, resolvePath, unstable_HistoryRouter, useHref, useInRouterContext, useLinkClickHandler, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams)

try use Routes as Switch

jatin711-debug commented 2 years ago

Instead of Switch import {Routes,Route,Navigation} from 'react-router-dom';

Route exact path="/" element={}/>
darkknight20032001 commented 2 years ago

React Router Dom has been updated with its latest version. Use Routes instead of Switch import {BrowseRouter, Routes, Route} from {react-router-dom};