Creating a Single-Page App in React using React Router


Yeah, I agree, as long as it works. Oh well, no worries, haha

I really appreciate your taking a look, too


Is the finished code for this tutorial hosted somewhere? Thanks!


have been solve



Follow this

import React, {
} from 'react'
import {
  BrowserRouter as Router,
} from 'react-router-dom';
import Home from './Home'
import Stuff from './Stuff’
import Contact from './Contact'

export default class Main extends Component {

  render() {
    return (
          <h1>Simple SPA</h1>
          <ul className="header">
              <Link to="/">Home</Link>
            <li><a href="/stuff">Stuff</a></li>
            <li><a href="/contact">Contact</a></li>
          <div className="content">
            <Route exact path="/" component={Home}/>
            <Route path="/stuff" component={Stuff}/>
            <Route path="/contact" component={Contact}/>


What is the problem here? :slight_smile: