티스토리 뷰

728x90
반응형

참조 : https://wooogy-egg.tistory.com/49

 

리액트 - history.push() 이후 refresh 안되는 문제

https://binaryjourney.tistory.com/15?category=916264 문제 현재 윗글 블로거 님의 글을 보면서 내가 개발하려는 서비스에 맞춰서 진행을 하고 있었다. (현재 개발하고 있는 서비스는 게시판 서비스와 동일하

wooogy-egg.tistory.com

 

const customHistory = createBrowserHistory(); // thunk 미들웨어에서 history 객체 사용하기 위해서

const store = createStore(reducers, applyMiddleware(ReduxThunk.withExtraArgument({ history: customHistory }), composeWithDevTools));

미들웨어에서 history를 사용하기 위해 미들웨어에 history를 추가하였는데

push 후 화면이 렌더 되지않음

 

const customHistory = createBrowserHistory({
  forceRefresh: true
}); // thunk 미들웨어에서 history 객체 사용하기 위해서

const store = createStore(reducers, applyMiddleware(ReduxThunk.withExtraArgument({ history: customHistory }), composeWithDevTools));

forceRefresh 옵션을 주어 렌더 되는거 확인

728x90
반응형
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함