const test = axios.create({
baseURL: '',
params: {
key: key
}
})
const response = await test.get('videos', {
params: {
part: 'snippet'
}
});
return response.data
React Router: Declarative Routing for React
// inline 으로 하면 매번 컴폰언트가 새롭게 호출된다. 비추
<Route exact path="/" component={Auth(LandingPage, null)} />
// 아래처럼 하는게 좋다.
// 라우트 여러개 묶으려면 아래처럼 배열 사용
// exeact 을 넣어야 정확한 url로 이동이 된다.
<Route exact path=['/', '/home']>
<LandingPage />
<Route>
const history = useHistory()
const match = useMatch()