출처: https://bumcrush.tistory.com/182 [맑음때때로 여름]

상세 컨텐츠

본문 제목

Link to, history.push 의 차이

React

by 장동균 2020. 7. 27. 17:07

본문

비슷한 기능을 하는 두 태그가 어떤 차이가 있을 까 궁금했다. 사실상 하는 일이 똑같기 때문이다. 구글링을해본 결과

 

https://stackoverflow.com/questions/53363557/react-router-dom-difference-between-link-and-history-push

 

react-router-dom - Difference between link and history.push?

The difference between href and link I understand. But I want to know the difference between using the link and withrouter with history.push? If I have already accessed the page does history.push

stackoverflow.com

history.push는 url을 programatically하게 변화시킨다는 것이다. 이 말은 click 없이도 수행되어 질 수 있다는 이야기이다.

 

사실 이 설명만으로 이 둘을 구분하기는 불충분하다고 생각하지만, 자료도 없고 나도 아직 react에 대해 문외한이라 어떻게 접근할 방법이 없다 ㅠ.... 일단 둘을 구분하지 않고 사용하면서 천천히 둘의 차이를 고민해나갈 필요가 있겠다.

'React' 카테고리의 다른 글

antd Carousel(auto), a href  (0) 2020.08.04
lazy component, Switch  (0) 2020.07.30
map method  (0) 2020.07.29
참고하기 좋은 사이트들을 정리하자!  (0) 2020.07.24
modules, components, containers  (0) 2020.07.23

관련글 더보기

댓글 영역