일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- ES6 브라우저 지원 현황
- 소오름~
- .map()
- Math.min
- .split()
- 프로그래밍이란
- for반복문
- for문
- JavaScript
- 삼항연산자
- async-await
- 가우스의 공식
- a && b
- !x.includes()
- 구문과 의미
- 소름돋는 알고리즘
- 알고리즘
- 자바스크립트와 ECMAScript
- Promise.all()
- 행렬...
- arr.push()
- Ajax란?
- 자바스크립트
- 프로그래머스
- 프로그래머스 공원 산책
- 자바스크립트의 탄생배경
- array.reduce()
- 자바스크립트의 특징
- 어려운데ㅠㅠ
- 배열 최솟값
Archives
- Today
- Total
Ming's develop story
Chapter3 - BucketList에 styled-components 적용하기 본문
스파르타코딩클럽 - 항해99/항해99 Chapter3 - react 주특기 기본
Chapter3 - BucketList에 styled-components 적용하기
Ming 2021. 11. 17. 16:55BucketList.js 코드
import React from 'react';
import styled from "styled-components";
const BucketList = ({ list }) => {
const my_lists = list
return (
<div>
{
my_lists.map((list, index) => {
return (
<Itemstyle key={index}>
{list}
</Itemstyle>);
})
}
</div>
);
}
const Itemstyle = styled.div`
padding: 16px;
margin: 8px;
background-color: aliceblue;
`;
export default BucketList;
|
App.js 코드
import React from 'react';
import BucketList from './BucketList';
import './style.css';
import styled from "styled-components";
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
list: ['영화관 가기', '매일 책읽기', '수영 배우기'],
};
}
render() {
return (
<div className="App">
<Container>
<Title>내 버킷리스트</Title>
<Line />
<BucketList list={this.state.list} />
</Container>
</div>
);
}
}
const Container = styled.div`
background-color: #fff;
width: 50vw;
max-width: 350px;
margin: auto;
height: 80vh;
padding: 16px;
border: 1px solid #ddd;
border-radius: 5px;
`;
const Title = styled.h1`
color: slateblue;
text-align: center;
`;
const Line = styled.hr`
margin: 16px 0px;
`;
export default App;
|
'스파르타코딩클럽 - 항해99 > 항해99 Chapter3 - react 주특기 기본' 카테고리의 다른 글
Chapter3 - Ref를 사용해 리액트에서 돔요소 가져오기 (0) | 2021.11.17 |
---|---|
Chapter3 - vscode-styled-components 확장패키지 (react) (0) | 2021.11.17 |
Chapter3 - styled-components (0) | 2021.11.17 |
Chapter3 - css파일 만들어서 써보기 (0) | 2021.11.17 |
Chapter3 - 버킷리스트 복습용 (0) | 2021.11.17 |
Comments