Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tablemin03] 프론트엔드 2주차 미션 제출합니다. #5

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tablemin03
Copy link

No description provided.

Copy link
Collaborator

@hhhkdev hhhkdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

추가 미션까지 하시고 완벽하네요! 코드 짜는 양만 늘린다면 프로젝트를 진행하기에 충분한 실력이 되지 않을까 싶습니당 수고하셧고 남은 3주차 미션도 화이팅입니다~!

import {Link} from 'react-router-dom';

const Button = (props) => (
<header>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 전체를 header태그로 감싼 이유가 있을까요? 여기서 Button은 페이지의 기능을 하고 있는데 왜 쓰셧는지 궁금합니다!

Comment on lines +9 to +28
css={css`
text-align: center;
background: linear-gradient(180deg,black,yellow);
padding: 13% 10%;


h1{
font-size: 100px;
color: black;
}

button{
border: solid;
border-radius: 10px;
background: yellow;
width: 100px;
height: 50px;
font-size: 20px;
}
`}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emotion을 깔끔하게 잘 쓰셧군여 이 방식말고도 객체를 통해서 어떻게 css를 적용할 수 있는지, styled component가 무엇인지 알아보고 사용하면 더 좋을거 같아요!

+) 아마 리터럴 형태로 CSS 작성하느라 자동완성이 안되어 불편하셧을텐데, emotion-auto-css라는 익스텐션이 VS Code에 있어서 이거 이용하면 더 편리할 거예요

태그 식별자 뒤에 중괄호가 띄어쓰기가 안되어있는걸로 봐서, 포맷팅이 자동으로 되지 않는거 같은데 prettier에 대해서도 공부하면 좋을거 같습니당

function App() {
return (
<div>
<BrowserRouter>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BrowserRouter를 여기에 감싸도 되지만, index.js에서 App 컴포넌트를 감싸는 식으로 할수도 있답니당

Comment on lines +1 to +9
fetch("https://jsonplaceholder.typicode.com/posts/")
.then((res) => res.json())
.then((data) => {
let posts = data;

posts.map((post) =>{
console.log(post.title);
})
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fetch를 이용한 코드는 잘 작성하셨는데, 만약 이 코드 뒤에 다른 코드가 들어오게 된다면 원치 않은 결과가 나올 수도 있어요! async await을 이용해서 좀더 좋은 코드를 작성할 수 잇을거 같아여

마지막에 map으로 순회하셨는데, map의 경우는 반환하는 배열이 존재해요. 틀린건 아니지만 의도에 맞게 실행하려면 forEach를 사용하는게 더 나을거 같습니당

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants