티스토리 뷰
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
반응형
'Error > React.js' 카테고리의 다른 글
[React] Reducer "A" returned undefined during initialization (0) | 2021.07.22 |
---|---|
[React] Error: Cannot find module ‘webpack-cli/bin/config-yargs’ (0) | 2020.11.25 |
[React] componentDidUpdate setTimeout (0) | 2020.08.10 |
[React] Objects are not valid as a React child (0) | 2020.06.01 |
[React] Parse Error: Adjacent JSX elements must be wrapped in an enclosing tag (0) | 2020.06.01 |
댓글