I have created an app using create-nw-react-app. This basically creates a system app which uses reactjs.
So, I have created a route '/' which renders a particular component.
<Route
exact
path='/'
render={() => <Home />}
/>
But, the component was not getting rendered. So I have checked the url using window.location.href
and this is the url that I have obtained:
chrome-extension://dkmbccbbedageiokbcmfaegjedpbegcf/index.html?
Is Routing even possible with create-nw-react-app
?
"react-router": "^4.3.1", "react-router-dom": "^4.3.1",
class Tool extends Component {
render() {
return (
<React.Fragment>
{window.location.href}
<Breadcrumb>
<BreadcrumbItem><a href='/home'>Home</a></BreadcrumbItem>
<BreadcrumbItem><a href='/courses'>Courses</a></BreadcrumbItem>
</Breadcrumb>
<BrowserRouter>
<Switch>
<Route
exact
path='/home'
component={Home}
/>
<Route
exact
path='/courses'
component={CourseList}
/>
</Switch>
</BrowserRouter>
</React.Fragment>
)
}
}
Only the Breadcrumb
is getting rendered at start. Then, clicking any of those links is printing "Your file was not found" as Output.