Skip to Content
자바스크립트 + 리액트 디자인 패턴
book

자바스크립트 + 리액트 디자인 패턴

by 애디 오스마니(Addy Osmani), 윤창식
August 2024
Beginner to intermediate
384 pages
7h 38m
Korean
Hanbit Media, Inc.
Content preview from 자바스크립트 + 리액트 디자인 패턴
92
자바스크립트 + 리액트 디자인 패턴
const style = {
root: {
borderRadius: 3,
border: 0,
color: "white",
margin: "0 20px"
},
primary: {
background: "linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)"
},
secondary: {
background: "linear-gradient(45deg, #2196f3 30%, #21cbf3 90%)"
}
};
export default function CustomButton(props) {
return (
<Button {...props} style={{ ...style.root, ...style[props.color] }}>
{props.children}
</Button>
);
}
7.4
노출 모듈 패턴
이제 모듈 패턴에 익숙해졌으니 조금 개선된 버전을 알아봅시다. 크리스티안 하일만
Christian
Heilmann
의 노출 모듈 패턴입니다. 하일만이 공개 변수나 메서드에 접근하기 위해 가져온 메인
객체의 이름을 반복해서 사용해야 한다는 점에 답답함을 느끼면서 생겨났습니다. 또한 그는
객체 리터럴 표기법을 사용해 요소를 공개하는 것도 맘에 들지 않아 했습니다.
그 결과 모든 함수와 변수를 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

AI를 위한 필수 수학

AI를 위한 필수 수학

할라 넬슨
클라우드 엔지니어를 위한 97가지 조언

클라우드 엔지니어를 위한 97가지 조언

Emily Freeman, Nathen Harvey, 정기훈(Jung Ki Hun)

Publisher Resources

ISBN: 9791169212571