Chap05 -> Using route parameters -> Implementing more of the question page -> 2 & 3 & 4: Create a state for question
parent
191d87662d
commit
a51437c7cc
|
@ -1,9 +1,15 @@
|
||||||
|
/** @jsxImportSource @emotion/react */
|
||||||
|
import { css } from '@emotion/react';
|
||||||
|
import { gray3, gray6 } from './Styles';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
|
|
||||||
import { Page } from './Page';
|
import { Page } from './Page';
|
||||||
|
import { QuestionData, getQuestion } from './QuestionsData';
|
||||||
|
|
||||||
export const QuestionPage = () => {
|
export const QuestionPage = () => {
|
||||||
|
const [question, setQuestion] = React.useState<QuestionData | null>(null);
|
||||||
const { questionId } = useParams();
|
const { questionId } = useParams();
|
||||||
return <Page>Question Page {questionId}</Page>;
|
return <Page>Question Page {questionId}</Page>;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue