Chap03 -> Handling events -> Handling a button click event
parent
5772c175af
commit
e3810cc810
|
@ -17,14 +17,15 @@ export const HomePage = () => {
|
|||
doGetUnansweredQuestion();
|
||||
}, []);
|
||||
|
||||
console.log('rendered');
|
||||
const handleAskQuestionClick = () => {
|
||||
console.log('TODO - move to the AskPage');
|
||||
};
|
||||
|
||||
return (
|
||||
<Page>
|
||||
<div>
|
||||
<PageTitle>Unanswered Questions</PageTitle>
|
||||
<button>Ask a question</button>{' '}
|
||||
{/* This button component is passed as children of Page */}
|
||||
<button onClick={handleAskQuestionClick}>Ask a question</button>
|
||||
</div>
|
||||
{questionsLoading ? (
|
||||
<div>Loading...</div>
|
||||
|
|
Loading…
Reference in New Issue