Error: could not find react-redux context value; please ensure the component is wrapped in a <Provider>
4263
water Yi
작성한 질문수 5
0
Error: could not find react-redux context value; please ensure the component is wrapped in a <Provider>
LoginPage
C:/Users/su/Desktop/infran_node_react_practice/client/src/components/views/LoginPage/LoginPage.js:12
9 | const [Password, setPassword] = useState("")
10 |
11 |
> 12 | const dispatch = useDispatch();
| ^ 13 |
14 | const onEmailHandler=(event)=>{
15 | setEmail(event.currentTarget.value);
계속 이렇게 에러가 뜨는데..방법을 모르겠습니다..
해결하신 분 계실까요?
답변 1
0
안녕하세요 index.js 파일이 문제 인것 같은데 ~
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
//import * as serviceWorker from './serviceWorker';
import reportWebVitals from './reportWebVitals';
import { Provider } from 'react-redux';
import 'antd/dist/antd.css';
import { applyMiddleware, createStore } from 'redux';
import promiseMiddleware from 'redux-promise';
import ReduxThunk from 'redux-thunk';
import Reducer from './_reducers';
const createStoreWithMiddleware = applyMiddleware(promiseMiddleware,ReduxThunk)(createStore)
ReactDOM.render(
<Provider
store={ createStoreWithMiddleware(Reducer,
window.__REDUX_DEVTOOLS_EXTENSION__ &&
window.__REDUX_DEVTOOLS_EXTENSION__()
)}
>
<App />
</Provider>
,
document.getElementById('root')
);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
혹시 이런식으로 되어있나요 ?
깃 이메일이랑 비번이 필요하다고 하네요
0
54
1
404 에러
0
120
1
34강 인증 체크에서 element 사용 때문에 에러나시는 분들 이렇게 하심 됩니다.
0
138
1
로그인, 로그아웃, 토근 작동 안 함
0
256
0
9강 오류 어떻게 해결하나요?
0
198
1
localhost 에서 연결을 거부했습니다.
0
1971
4
포스트맨에서 true가 안떠요
0
157
1
왜 안되나요
0
133
1
몽고db 연결 오류가 납니다 위에껀 입력한 코드, 아래껀 터미널이에요
0
250
1
로그아웃 401 에러(Unauthorized)
0
519
2
암호가 해싱되지 않고 입력값 그대로 db에 저장되는 문제
0
158
1
7강중에서
0
176
2
User.findByToken is not a function
0
215
1
루트 디렉토리
0
281
1
useState
0
570
1
프록시 잘 설정했는데도 404 오류 뜨는 분들
5
905
6
webpack 관련 에러 질문
0
225
1
리액트 관련 질문
0
282
1
14강 로그아웃 안됨
0
325
1
mongoDB 데이터 확인하는 법
0
414
1
postman 에러
0
297
1
선생님 리덕스를 사용하면 어떠한 부분이 좋은지 알 수 있을까요?
0
239
1
다음과 같은 에러들이 발생합니다.
0
282
1
14강 로그아웃 기능 구현시 postman에서 Cannot POST 오류가 뜹니다.
0
385
1





