Header 부분을 작성한다.
const LoggedInRoutes = () => (
<Switch>
<Route exact path="/" component={Feed} />
<Route path="/explore" component={Explore} />
<Route path="/search" component={Search} />
<Route path="/:username" component={Profile} />
</Switch>
);
redirect search page
검색어를 입력 후 submit하게 되면 해당 검색어와 함께 Search route로 redirect
router 정보를 받아 사용할 수 있다.
reload 없이 Search route로 redirect를 하기 위해 사용
ME Query call with Authorization
Apollo boost에서 request할 시에 "Authorization" 값을 넘겨주어 인증 된 정보를 가져올 수 있도록 하기 위함
Apollo boost configuration
ApolloClient config 추가
headers: {
Authorization: `Bearer ${localStorage.getItem("token")}`,
},
complete