I am trying to do the create note step of the tutorial.
However, my react-router is acting super weird.
Instead of rendering the component, it looks for localhost:8080/notes/main.js
and throws a 404 error.
When I try a simple path with no extra slash /notes
for example it renders fine.
Here is my Routes.js:
import React from 'react'
import { Route, Switch } from "react-router-dom";
import Home from "./containers/Home";
import Login from "./containers/Login";
import NotFound from "./containers/NotFound";
import Signup from "./containers/Signup";
import NewNote from "./containers/NewNote";
export default function Routes( props ) {
return (
<Switch>
<Route path="/" exact component={Home} />
<Route path="/notes/login" exact component={Login} />
<Route exact path="/signup" component={Signup}/>
<Route exact path="/notes/new" component={NewNote} />
{ /* Finally, catch all unmatched routes */ }
<Route component={NotFound} />
</Switch>
);
}
If you want to see more code and screenshots then this is my StackOverflow post as it’s not easy adding everything his in Discourse.