React/React 오류 창고

React/React 오류 창고

[리액트 + 스프링 연동] CORS 오류 해결

Access to XMLHttpRequest at 'http://localhost:8080/api/hello' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. 이와 같은 오류가 발생하는 경우 해결책을 찾는 게시글이다. HelloWorldController.java package com.dotori.daram.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bin..

React/React 오류 창고

[리액트] Cannot read properties of undefined (reading 'location')

App.js import React, {useEffect, useState} from 'react'; import axios from 'axios'; import {Route, Router, Switch} from "react-router-dom"; import LandingPage from "./Components/LandingPage"; export default function App() { return ( ); } 실행했더니 다음과 같은 오류가 발생한다. Cannot read properties of undefined (reading 'location') TypeError: Cannot read properties of undefined (reading 'location') at new Route..

React/React 오류 창고

[리액트] export 'Switch' (imported as 'Switch') was not found in 'react-router-dom'

App.js import React, {useEffect, useState} from 'react'; import axios from 'axios'; import {Route, Router, Switch} from "react-router-dom"; import LandingPage from "./Components/LandingPage"; function App() { return ( ); } export default App; 해당 코드를 작성하여 실행하니 export 'Switch' (imported as 'Switch') was not found in 'react-router-dom' 오류가 발생했다. 이는 Switch를 찾을 수 없다는 오류이다. 왜냐하면 버전6 이상에서 Switch가 삭제되었기..

daramG
'React/React 오류 창고' 카테고리의 글 목록