The App component includes the page heading and a list of links to various article categories. When the user moves around the user interface, the App component is always rendered, but each <Route> element renders different content based on the current route. Let's take a look at the component, and then we'll break down how it works:
import React from "react";
import { BrowserRouter as Router, Route, NavLink } from "react-router-dom";
import { connect } from "react-redux";
import Home from "./Home";
import Article from "./Article";
function articleList(filter) {
return props => <Home {...props} filter={filter} />;
}
const categoryListStyle = {
listStyle: "none",
margin: 0,
padding: 0,
display: "flex"
};
const categoryItemStyle = {
padding: "5px"
};
const Local = articleList("local");
const Global = articleList("global");
const Tech = articleList(...