velopert / react-tutorial

벨로퍼트와 함께하는 모던 리액트 튜토리얼 문서
https://react.vlpt.us/
350 stars 101 forks source link

5. useReactRouter Hook 사용하기 · GitBook #18

Open utterances-bot opened 4 years ago

utterances-bot commented 4 years ago

5. useReactRouter Hook 사용하기 · GitBook

https://react.vlpt.us/react-router/05-use-router-hook.html

HYEOK999 commented 4 years ago

RouterHookSampe.js 코드가 잘못된 부분이 있는것 같습니다. useReactRouter(); 로 호출 해주어야 하는 거 아닌가요?

RouterHookSample.js import useReactRouter from 'use-react-router';

function RouterHookSample() { const { history, location, match } = useReactRouter(); console.log({ history, location, match }); return null; }

export default RouterHookSample;

up0617 commented 4 years ago

https://reactrouter.com/web/api/Hooks React Route Hooks 업데이트 되었습니다~