Creating a Single-Page App in React using React Router


#42

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

I really appreciate your taking a look, too


#43

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


#44

have been solve


#45


#46

Follow this

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

export default class Main extends Component {

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

#47

What is the problem here? :slight_smile: