When i finished my basic routing structure and tested it on Localhost, everything worked fine.
Mycode:
const Routes = () => {
return (
<Router>
<Header />
<Switch>
<Route exact path="/" component={Home} />
<Route exact path="/groups" component={AllGroups} />
<Route exact path="/discussion" component={Discussion} />
<Route exact path="/group" component={Group} />
<Route exact path="/profile" component={Profile} />
<Route exact path="/search" component={Search} />
</Switch>
</Router>
)
}
However, when i deployed it on Firebase, everything become a whole mass:
For example, i got this page on http://localhost:3000/search.
But got this on Firebase(Home component).
The others, groups, group is OK, but discussion, profile, search also show the Home component.
What did i do wrong?
Well, it turns out the Firebase takes some time to compile, just like Heroku.
This morning i inputted '/search' again and could get a correct result.