Skip to content
Permalink
Browse files

feat: search page with query params

  • Loading branch information...
Param-Harrison committed Apr 22, 2019
1 parent f6935df commit 9c3e6a38528f34269158da6b24fade7a862299ec
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/App.js
@@ -57,17 +57,30 @@ const UserPage = ({ match, location }) => {
);
};
const SearchPage = ({ match, location }) => {
return (
<p>
<strong>Query Params: </strong>
{
location.search
}
</p>
);
}
const App = () => {
return (
<section className="App">
<Router>
<Link to="/">Home</Link>
<Link to="/about">About</Link>
<Link to="/users">Users</Link>
<Link to="/search?q=react">Search</Link>
<Route exact path="/" component={IndexPage} />
<Route exact path="/users" component={UsersPage} />
<Route exact path="/user/:userId" component={UserPage} />
<Route exact path="/about" component={AboutPage} />
<Route exact path="/search" component={SearchPage} />
</Router>
<a href="/about">about with browser reload</a>
</section>

0 comments on commit 9c3e6a3

Please sign in to comment.
You can’t perform that action at this time.