Chap05 -> Using route parameters -> Implementing more of the question page -> 2 & 3 & 4: Create a state for question

master
Jason Zhu 2022-03-30 14:14:23 +11:00
parent 3fb4435d68
commit de5e78e621
1 changed files with 6 additions and 0 deletions

View File

@ -1,9 +1,15 @@
/** @jsxImportSource @emotion/react */
import { css } from '@emotion/react';
import { gray3, gray6 } from './Styles';
import React from 'react';
import { useParams } from 'react-router-dom';
import { Page } from './Page';
import { QuestionData, getQuestion } from './QuestionsData';
export const QuestionPage = () => {
const [question, setQuestion] = React.useState<QuestionData | null>(null);
const { questionId } = useParams();
return <Page>Question Page {questionId}</Page>;
};