일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- BFS
- 알고리즘
- Algorithm
- 리트코드
- 자바
- react
- 다이나믹 프로그래밍
- VIM
- Data Structure
- TypeScript
- Redux
- db
- Python
- 백준
- 프로그래머스
- CS
- DP
- network
- Javascript
- Database
- java
- git
- 동적 계획법
- 그레이들
- 안드로이드
- Graph
- vscode
- LeetCode
- frontend
- DFS
Archives
- Today
- Total
목록useHistory (1)
늘 겸손하게
React - react-router-dom - useHistory + 데이터 전달
다른 페이지로 리다이렉트하는 기능을 history.push로 구현해보겠습니다. 1. react-router-dom 설치 1 npm i react-router-dom cs 2. useHistory import 1 import { useHistory } from 'react-router-dom'; cs 3. 변수 생성 1 const history = useHistory(); cs 4. history.push에 이동할 경로 넣기 1 history.push('이동할 경로') cs history.push 메소드가 실행되면 현재 경로에 '이동할 경로'가 붙은 경로로 리다이렉션됩니다. + history.push 로 이동할 경로에 데이터 전달 state에 데이터를 담아서 이동할 경로에 데이터를 전달할 수 있습니다. e..
Programming/React
2022. 7. 13. 16:55