Today I Learned & Did
- have been reading official docs of React.js til 4th one in main concepts.
- About JSX
: 1. Should use ONE element only and if you'd like to use other elements, they've gotta be inside the element.
2. Should embed Javascript inside {}.
3. Can't use if statements inside JSX so use conditional operator instead yet, it's alright to use JSX inside if statements
4. It's className when you want to declare class's name unlike html which is class in
- React Key Concepts
: 1. Data Flow -> 단 방향 데이터 흐름
2. Props -> 상위 컴포넌트가 하위 컴포넌트에게 내려주는 데이터 (하위 컴포넌트는 사용만 할 수 있을 뿐, 변경 불가)
3. State -> 상태, 객체의 형태로 컴포넌트 내에서 보관 및 관리
: 클래스 컴포넌트로 작성, 값을 변경하고 싶을 떈 메서드 setState사용 (사용시 render() 함수 실행되는 점 기억)
4. Life Cycle -> 컴포넌트가 브라우저에 보여질 때, 업데이트될 때, 사라질 때 등 각 단계 전,후로 특정 메서드가 호출된다.
: 생성 시, constructor()-호출 => render() => componentDidMount()
: 업데이트 시, setState()-state값 변경 => render() => componentDidUpdate()
: 컴포넌트가 클래스로 작성되어야 실행, 함수로 작성되면 실행 X
하루 체크리스트
- 수면시간 지키기 : O
- 알고리즘 문제 풀이 : O
- 운동하기 : X
- 배운 내용 복습&정리 : O
- 새로운 내용 공부 (코스 외 공부) : X
'150일 안에 개발자 되기' 카테고리의 다른 글
200907 TILAD #D85 (0) | 2020.09.07 |
---|---|
200825 TILAD #D72 (0) | 2020.08.25 |
200819 TILAD #D66 (0) | 2020.08.20 |
200818 TILAD #D65 (0) | 2020.08.18 |
200814 TILAD #D61 (0) | 2020.08.18 |