inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

React로 NodeBird SNS 만들기

4-15. 댓글 컴포넌트 만들기

버튼 눌러도 반응이 없어여

303

terecal

작성한 질문수 162

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

isAddingComment (pin): 
addCommentErrorReason (pin) : 
81 
asdfasdf 
BHI 
e NodeBird 
NodeBird 
c 
0 127 0.0.1:3000 
sitel todo 
0101 0104Lh? 
010111 
: 12.95 
skill note 
Log In - Vultr.com 
71 El 
filter.. 
HELLO SAGA 
HELLO SAGA 
LOG 
IN REWEST 
LOG 
IN SUCCESS 
ADD POST_REQUEST 
ADD POST SUCCESS 
Inspector 
+øø:ee.øe 
+øø:ø2.93 
+øø:ø2.øe 
+øø:19.86 
+øø:ø2.øe 
+øø:ø2.ø1 
+øø:ø2.ø2 
+26 
+øø:ø2.ø1 
rmance 
Action 
Redux 
NodeBird 
07 
Trace 
x 
Test 
Diff 
Tree 
post (pin) 
State 
Diff 
CHOIßl_lCh 
ADD CU*4E-NT 
ADD CU*4E-NT 
ADD CU*4E-NT 
ADD CU*4E-NT 
ADD CU*4E-NT 
ADD CU*4E-NT 
type: 
Console 
REQUEST 
FAILURE 
REQUEST 
FAILURE 
REQUEST 
FAILURE 
O Pause 
What's New X Search 
Highlights from the Chrome 76 update 
Autocomplete with CSS keyword values 
Typing a keyword value like "bold" in the Styles pane now autocompletes 
to "font-weight: bold".

 

 

에러 메세지는

 

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

 

컴포넌트

https://github.com/hyunsokstar/node_bird_11/blob/master/front/components/PostCard.js

리듀서

https://github.com/hyunsokstar/node_bird_11/blob/master/front/reducers/post.js

리덕스 사가

https://github.com/hyunsokstar/node_bird_11/blob/master/front/reducers/post.js

 

 



react javascript

답변 1

0

제로초(조현영)

ch4에서는 댓글 등록이 안 되는게 맞습니다. 처음에 있던 더미 게시글에는 들어가지만, 새로 만든 게시글에는 댓글이 안 달립니다.

next 10 이상에서는 redux dev tool 구동이 안되나요?

0

272

1

세션 갱신 문의 건

0

484

7

배포 진행 후 Highlight updates components render 표시

0

445

1

똑같은 기능을 하는 테이블

0

448

4

관계형

0

312

2

프론트 서버를 이용하지 않는경우

1

299

3

인피니트 스크롤링 사용시 오류

0

278

0

계속 이런에러가 떠서 해결하기는 했는데 어떤 의미인지 모르겠습니다.

0

435

2

req.user가 언제 생성되나요??

0

330

2

Cannot read property 'id' of null 에러

0

333

1

리트윗한 게시글 불러오는 sequelize

0

252

1

result.data에서 images인 이유

0

281

2

takeLatest에 대한 질문입니다.

1

342

2

프론트에서 express를 사용하지 않을때 동적라우팅

0

501

6

getInitialProps가 클라이언트에서 수행되는 이유?

0

258

1

리로드하면 팔로우 언팔로우 값이 초기화 되는 문제입니다.

0

445

2

스타일드 컴포넌트와 className을 통한 스타일 적용의 차이에 대해 궁금합니다

0

585

2

할인 쿠폰 사용이 안되는되요 (848-f9af83f183e3)

0

365

1

nodejs mvc 패턴

0

976

4

사용하고 보니, 람다 구성이 궁금합니다!

0

266

1

제로초님

0

445

1

새로고침 로그인 풀림 문제.

0

247

1

안녕하세요. 강의 너무 감사합니다

0

157

1

제로초님

0

170

1