I am new to react and I was trying to make routes but its not working properly.
Here is my code:
<div className = "music-box">
<Switch>
<Route exact path = "/">
<div id = "trending-container" className = "user-musics">
{musics && musics.map((name, i)=>{
return(
<Fragment key = {i}>
<MusicPreview
name = {name}
play = {play}
uID = {name.userID}
userName = {currentUserName}
pfp= {name.pfpURL}
user = {name.artist}
/>
</Fragment>
)
})}
</div>
</Route>
<Route exact path = {"/results"}>
<div className = "user-musics">
results
</div>
</Route>
</Switch>
</div>
Whenever I go to http://localhost:3000/results
the page is blank and its not rendering anything.