Search bar no hace search y correccion de bug en makelink

This commit is contained in:
Daniel Cortes
2020-06-04 21:22:15 -04:00
parent 964df61284
commit b5e0d85b3b
3 changed files with 38 additions and 37 deletions

View File

@@ -10,12 +10,16 @@ import {Nav} from "./components/Nav";
import {BrowserRouter, Switch, Route} from "react-router-dom";
const Main = (props) => (
<Fragment>
<h1>Busca la musica que te gusta!</h1>
<SearchBar history={props.history}/>
</Fragment>
)
const Main = (props) => {
const navigate = (query) => props.history.push(`/search?query=${query}`);
return (
<Fragment>
<h1>Busca la musica que te gusta!</h1>
<SearchBar history={props.history} onQueryChanged={navigate}/>
</Fragment>
)
}
const NoRoute = (props) => {
return (