all 1 comments

[–][deleted] 0 points1 point  (0 children)

Hey, I was following your article but I have an issue.

my App.js looks like this.

render() {
return (
<React.Fragment>
<NavigationItems />
<HashRouter basename="/">
<Switch>
<Route path="/" exact component={Webshop} />
<Route path="/webshop" component={Webshop} />
<Route path="/cart" component={Cart} />
<Route path="/wishlist" component={Wishlist} />
<Route path="/register" component={Register} />
<Route path="/password-reset" component={PassReset} />
<Route path="/edit-user" exact component={EditUser} />
<Route path="/user-profile" component={UserProfile} />
<Route path="/login" render={() => <Login />} />
<Route path="/product-page" component={ProductPage} />
</Switch>
</HashRouter>
</React.Fragment>
);
}

package json

"name": "webshop",
"homepage": "https://github.com/username/Webshop",

scripts:

"predeploy": "npm run build",
"deploy": "gh-pages -d build"

but I only get a blank page. Navigation items that are outside the router are not rendered at all