DEV Community

Discussion on: Routes not working when react app is build

Collapse
 
tylerferrara profile image
Tyler Ferrara

At this time, you are telling react to render "Not Found" with an additional "}/>" that doesn't seem to belong.

Follow along with the React Router Docs: reacttraining.com/react-router/web...

// First import the correct modules
import React from "react";
import ReactDOM from "react-dom";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";

/*
Your Code Here
*/

// Render your root Component to the DOM
ReactDOM.render((
// Wrapping Routes in Router
// Render Home Component
// Render Blog Component
// Only renders when no match was found

), document.getElementById("root"));

registerServiceWorker();

Use this as a template for the routing, but make sure to checkout the original documentation. They lay it out clean and simple.

Hope this helps :D

Collapse
 
gihanrangana profile image
GihanRangana

thanks for helping.routing component is not shown on the post