Chap05 -> Implementing links -> Navigating programmatically

master
Jason Zhu 2022-03-29 16:24:10 +11:00
parent 89ea270218
commit 379feb7e99
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,6 @@
/** @jsxImportSource @emotion/react */ /** @jsxImportSource @emotion/react */
import { css } from '@emotion/react'; import { css } from '@emotion/react';
import { useNavigate } from 'react-router-dom';
import React from 'react'; import React from 'react';
import { PageTitle } from './PageTitle'; import { PageTitle } from './PageTitle';
@ -21,8 +22,9 @@ export const HomePage = () => {
doGetUnansweredQuestion(); doGetUnansweredQuestion();
}, []); }, []);
const navigate = useNavigate();
const handleAskQuestionClick = () => { const handleAskQuestionClick = () => {
console.log('TODO - move to the AskPage'); navigate('ask');
}; };
return ( return (