리다이렉트 오류가납니다 ㅠㅠ
1363
김관김관
작성한 질문수 5
1
×
Unhandled Rejection (TypeError): Cannot read property 'push' of undefined
(anonymous function)
C:/Users/rlaqu/OneDrive/Desktop/boiler-plate/client/src/components/views/RegisterPage/RegisterPage.js:50
542 | };
543 | dispatch(Object(_action_user_action__WEBPACK_IMPORTED_MODULE_2__["registerUser"])(body)).then(response => {
544 | if (response.payload.success) {
> 545 | props.history.push('/login');
| ^ 546 | } else {
547 | alert('failed to sign up');
548 | }
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error. Click the 'X' or hit ESC to dismiss this message.
Open your browser’s developer console to further inspect this error. Click the 'X' or hit ESC to dismiss this message.
회원가입결과 true가 리턴되는건 확인했는데요 리다이렉트부분이 먹통입니다 ㅠㅠ
뭐가 문제일까요??
답변 2
1
혹시 withRouter 란것 쓰셨나요 ~ ?
마지막줄에
export default withRouter(RegisterPage)
이걸로 감싸주셔야 합니다
그리고 withRouter는
import { withRouter } from 'react-router-dom';
이렇게 가져와주시면 됩니다 ~!
깃 이메일이랑 비번이 필요하다고 하네요
0
35
1
404 에러
0
102
1
34강 인증 체크에서 element 사용 때문에 에러나시는 분들 이렇게 하심 됩니다.
0
119
1
로그인, 로그아웃, 토근 작동 안 함
0
239
0
9강 오류 어떻게 해결하나요?
0
194
1
localhost 에서 연결을 거부했습니다.
0
1927
4
포스트맨에서 true가 안떠요
0
150
1
왜 안되나요
0
129
1
몽고db 연결 오류가 납니다 위에껀 입력한 코드, 아래껀 터미널이에요
0
243
1
로그아웃 401 에러(Unauthorized)
0
504
2
암호가 해싱되지 않고 입력값 그대로 db에 저장되는 문제
0
149
1
7강중에서
0
162
2
User.findByToken is not a function
0
211
1
루트 디렉토리
0
271
1
useState
0
560
1
프록시 잘 설정했는데도 404 오류 뜨는 분들
5
875
6
webpack 관련 에러 질문
0
219
1
리액트 관련 질문
0
272
1
14강 로그아웃 안됨
0
318
1
mongoDB 데이터 확인하는 법
0
409
1
postman 에러
0
291
1
선생님 리덕스를 사용하면 어떠한 부분이 좋은지 알 수 있을까요?
0
234
1
다음과 같은 에러들이 발생합니다.
0
273
1
14강 로그아웃 기능 구현시 postman에서 Cannot POST 오류가 뜹니다.
0
379
1





