Chap05 -> Implementing links -> Navigating programmatically
parent
89ea270218
commit
379feb7e99
|
@ -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 (
|
||||||
|
|
Loading…
Reference in New Issue