Web/Error Report 4

[React] React Router의 BrowserRouter에서 history.push후 Render 문제

최근 React Router를 이용하여 라우팅을 해주고 있는데, history.push를 썼는데 URL만 변경되고 렌더링이 안된다. history package의 버전이 달라서 그런 경우도 있겠으나... history.push not working when using BrowserRouter · Issue #4059 · remix-run/react-router startup file import {BrowserRouter} from 'react-router'; let root= //Some components ReactDOM.render(Root, document.getElementById("app"... github.com 나와 같은 고민을 하시는 분들의 해결법은, BrowserRouter가 histo..

Web/Error Report 2021.08.15

[React] history 버전 문제로 history.push후 Render 문제

React Router 5.2.0 버전을 사용 중인데, history package의 버전이 5.0.0으로 달라서 생기는 문제. yarn remove history로 history 5.0.0 버전을 지운 후, yarn add history@4.10.1을 쳐서 history 4.10.1 버전을 설치해준다. history.push is changing url but not rendering component in react I am facing a problem with react history.push . The logic of my code is, when the API call completes, if the login status in response is false, I want to push to..

Web/Error Report 2021.08.15

[React] TypeError: Cannot read property 'createElement' of undefined 오류

CMD에서 npm start나 yarn start로 React Client를 실행시켰을 때, 제목과 같이 TypeError: Cannot read property 'createElement' of undefined 오류를 볼 수 있는 경우가 있다. 이와 같은 문제가 일어난 이유는, import { React, useState } from 'react'; 와 같이 import가 제대로 되어 있지 않기 때문. Googling을 해보면 import * as React from 'react'; 로 해결하는 법이 있는데, 정확하게 해결하는 방법은 아래와 같다. import { React, useState } from 'react'; => import React, { useState } from 'react'로 바..

Web/Error Report 2020.10.15