본문 바로가기
반응형

FullStack/12. React4

export 'useHistory' (imported as 'useHistory') was not found in 'react-router-dom' react-router-dom v6에서 오류가 발생했다. // 소스 코드 import { useHistory } from "react-router-dom"; // 오류 발생 export 'useHistory' (imported as 'useHistory') was not found in 'react-router-dom' // react-router-dom v5 import { useHistory } from "react-router-dom" const Profile = () => { const history = useHistory(); const onLogOutClick = () => { history.push("/"); } }; useHistory -> Navigate로 변경 // react-route.. 2022. 1. 24.
export 'Redirect' (imported as 'Redirect') was not found in 'react-router-dom' export 'Redirect' (imported as 'Redirect') was not found in 'react-router-dom' react-router-dom v6 버전에서 Redirect가 사라지고 Navigate로 변경. // react-router-dom v5 import { HashRouter as Router, Redirect, Switch, Route } from "react-router-dom"; const AppRouter = ({ isLoggedIn }) => { return ( ); }; export default AppRouter; // react-router-dom v6 import { HashRouter as Router, Navigate, Routes, Route }.. 2022. 1. 24.
export 'Switch' (imported as 'Switch') was not found in 'react-router-dom' "Do it! 클론 코딩 트위터" 예제 진행 중, 'react-router-dom'에서 Switch를 찾을 수 없다는 오류가 발생했다. react-router-dom 6 버전에서 Switch가 Routes로 변경되었다. 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, createRoutesF.. 2022. 1. 21.
export 'default' (imported as 'firebase') was not found in 'firebase/app' "Do it! 클론 코딩 트위터" 예제 진행 중, 'firebase/app'을 찾을 수 없다는 오류가 발생했다. firebase 9.버전에서 "firebase/app" 모듈 사용법이 변경되었다. firebase 8 버전과 9 버전의 사용법이 변경되어, v8 코드를 그대로 사용하기 위해서는 api를 'firebase/compat/'으로 사용하면 된다. export 'default' (imported as 'firebase') was not found in 'firebase/app' (possible exports: FirebaseError, SDK_VERSION, _DEFAULT_ENTRY_NAME, _addComponent, _addOrOverwriteComponent, _apps, _clearCompo.. 2022. 1. 21.
반응형