작성
·
268
0
삐약 버튼을 누르면
code |
<Button type="primary" htmlType="submit" loading={isAddingComment}>삐약</Button> |
리덕스 사가에 의해 댓글 추가가 실행 되는데요
code |
function* addComment(action) { try { yield delay(2000); yield put({ type: ADD_COMMENT_SUCCESS, data: { postId: action.data.postId, }, }); } catch (e) { yield put({ type: ADD_COMMENT_FAILURE, error: e, }); } }
function* watchAddComment() { yield takeLatest(ADD_COMMENT_REQUEST, addComment); }
export default function* postSaga() { yield all([ fork(watchAddPost), fork(watchAddComment), ]); |
문제는
type: ADD_COMMENT_FAILURE,
가 실행되요 이유가 뭔지 몰겠어요
test |
|
에러 메세지는
error1 |
Warning: Encountered two children with the same key, `[object Object]`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version. in div (at pages/index.js:28) in Home (at _app.js:26) in div (created by Context.Consumer) in Col (at AppLayout.js:32) in div (created by Context.Consumer) in Row (at AppLayout.js:25) in div (at AppLayout.js:15) in AppLayout (at _app.js:25) in Provider (at _app.js:20) in NodeBird (created by withRedux(NodeBird)) in withRedux(NodeBird) in Suspense (created by AppContainer) in Container (created by AppContainer) in AppContainer |
error2 |
:3000/_next/static/runtime/main.js?ts=1566728379331:10978 Warning: Encountered two children with the same key, `[object Object]`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version. in div (at pages/index.js:28) in Home (at _app.js:26) in div (created by Context.Consumer) in Col (at AppLayout.js:32) in div (created by Context.Consumer) in Row (at AppLayout.js:25) in div (at AppLayout.js:15) in AppLayout (at _app.js:25) in Provider (at _app.js:20) in NodeBird (created by withRedux(NodeBird)) in withRedux(NodeBird) in Suspense (created by AppContainer) in Container (created by AppContainer) in AppContainer |
인데 해석이 안되요
혹시 이유를 아시면 알려주시면 대단히 감사여
github