Skip to content

Instantly share code, notes, and snippets.



Created Aug 7, 2019
What would you like to do?
Router switch for rendering page components
import React, { Component, Fragment } from "react";
import { Switch, Route } from "react-router-dom";
import Routes from "../routes";
import Header from "./components/header/header";
export default class App extends Component {
render() {
return (
<Header />
{, index) => (
<Route key={index} path={c.url} exact component={c.component} />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment