<NavBar />
<Switch>
<Route exact path="/">
<Main />
</Route>
<Route path="/posts">
<Posts />
</Route>
<Route path="/beans">
<Beans />
</Route>
<Route path="/myPage">
<MyPage />
</Route>
</Switch>
</>
<NavBar />
<Routes>
<Route exact path="/" element={<Main />} />
<Route path="/posts" element={<Posts />} />
<Route path="/beans" element={<Beans />} />
<Route path="/myPage" element={<MyPage />} />
</Routes>
eslint rules 추가
{
"extends": ["react-app",
"eslint:recommended",
"plugin:react/recommended"],
"rules": { "react/prop-types": ["off"] }
}
eslint prop types 오류
upStream에서 styled-component로 잘못 설정함.
잘못 설치하여 재설치 필요
display: flex;
flex-wrap: wrap;
justify-content: space-between;
이렇게 해도 정렬은 되지만, 조금이라도 디자인이 바뀌면 다시 작성해야한다.
& li {
display: inline-block;
margin: 4px;
}
& li:not(:nth-child(4n)) {
margin-right: 20px;
}
& li {
margin-bottom: 20px;
}
display: grid;
grid-template-columns: repeat(auto-fill, 250px);
justify-content: space-between;
grid-gap: 20px;
참고)
https://travishorn.com/some-ways-to-align-the-last-row-in-a-flexbox-grid-720f365dcb16