-
Notifications
You must be signed in to change notification settings - Fork 0
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
Kdt5-방미선-영화검색 #61
base: main
Are you sure you want to change the base?
Kdt5-방미선-영화검색 #61
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
부족한부분 코멘트 남겼습니다.
this.state = state // 컴포넌트 안에서 사용할 데이터 | ||
this.render() | ||
} | ||
render() { // 컴포넌트를 렌더링하는 함수 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
component 를 렌더링 하는 함수를 여기서 선언했는데 왜 매번 컴포넌트에서 RENDER함수를 overwrite하신걸까요?
acc[key] = value | ||
return acc | ||
}, {}) | ||
history.replaceState(query, '') // (상태, 제목) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaceState를 하시면 historyStack이 안쌓일텐데 혹시 이렇게 구현하신 이유가 있나요?
theFooter | ||
) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apped가 아닌 Layout을 만들어서 선언했어도 될 것 같아요
</h1> | ||
` | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Headline이라는 추상화된 컴포넌트명을 쓰고 굳이 props를 활용하지 않은 이유가 뭔가요?
this.el.setAttribute('href', `#/movie?id=${movie.imdbID}`) | ||
this.el.classList.add('movie') | ||
this.el.style.backgroundImage = `url(${movie.Poster})` | ||
this.el.innerHTML = /* html */ ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
뭔가 되게 구조가 복잡한 것 같아요
this.el을 직접건드리신 이유가 뭔지 모르겠어요.
import { Component } from '../core/CoreMovie' | ||
import movieStore, { getMovieDetails} from '../store/movie' | ||
|
||
export default class Movie extends Component { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어디는 append로 쓰고 어디는 innerHTML로 쓰고 너무 뒤죽박죽이에요
github: 'https://github.com/0299bang', | ||
repository: 'https://github.com/0299bang/Search-Movies-API' | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Store가 CoreMovie안에 들어가는것보다 store/index.js로 만드는게 좋아보여요
} | ||
} | ||
// 영화의 상세정보를 가져오는 함수 만들기 | ||
export const getMovieDetails = async id => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ajax는 따로 모아서 관리하시는걸 추천드립니다.
store.state.message = '' // 빈 문자로 초기화 | ||
} | ||
try { | ||
const res = await fetch('/api/movie', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이것 역시 따로 관리하는게 좋아보여요
response | ||
.status(200) | ||
.json(json) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어디는 AP에 만들어두고 어디는 함수 안에서 fetch 호출하는 구조가 통일성이 없어요
🎬 영화 검색
배포링크: https://movie-api-black.vercel.app/
❗ 필수
❔ 선택
npm 프로젝트 생성
devDependencies
dependencies