react-tutorial
react-tutorial copied to clipboard
5. useReactRouter Hook 사용하기 · GitBook
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;
https://reactrouter.com/web/api/Hooks React Route Hooks 업데이트 되었습니다~