December 2019
Intermediate to advanced
598 pages
12h 21m
English
Let's carry out the following steps to add the question page route:
import { QuestionPage } from './QuestionPage';
<Switch> <Redirect from="/home" to="/" /> <Route exact path="/" component={HomePage} /> <Route path="/search" component={SearchPage} /> <Route path="/ask" component={AskPage} /> <Route path="/signin" component={SignInPage} /> <Route path="/questions/:questionId" component={QuestionPage} /> <Route component={NotFoundPage} /></Switch>
Note that the path we entered contains questionId at the end.
Read now
Unlock full access