December 2019
Intermediate to advanced
474 pages
10h 3m
English
With the first route in place, other routes can be added to the router component. A logical one is having a route for individual questions, that has an extra parameter that specifies which question should be displayed. Therefore, a new container component called Question must be created, which contains the logic for fetching a question from the Stack Overflow API. This component is rendered when the path matches /question/:id, where id stands for the ID of the question that is clicked on from the feed:
import React, { Component } from 'react';import styled from 'styled-components';const ...