Chap03 -> Handling events -> Handling a button click event
parent
0f31f492cc
commit
7dd02a76ea
|
@ -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