[원티드프리온보딩] 220505

김듑듑·2022년 5월 5일
0

TIL

목록 보기
3/33

props

어쩌구저쩌구 is missing in props validation

따로 props 타입 선언도 해줘야하고 그 전에 설치도 해줘야함
npm install --save prop-types
import PropTypes from 'prop-types';


Prop type 어쩌구 is forbidden

any 🙅
array 👉 arrayOf
object 👉 shape

Must use destructuring props assignment

  • es6, 구조분해할당 : 함수에서 props를 통으로 넘겨받으면 안에서 분해하던가, 분해해서 넘겨받으란 소리다.

props.children

As for "exceptions"
It would seem that some common properties such as props.children or props.className need to be treated as exceptions.
Why should children be an exception?
Most components don't need this.props.children, so that makes it extra important to document children in the prop types.
Generally, you should use PropTypes.node or static type React.Node for children.
It accepts anything that can be rendered: numbers, strings, elements or an array containing these types.


no-static-element-interactions


증감연산자 쓰면 안됨....

🙅 for (i = 0; i < l; i++ ) {...}
🙆 for (i = 0; i < l; i+=1 ) {...}

삼항 연산자 깔끔하게 써야함

🙅 you===me?true:false
🙆 you===me
  • 오류삑삑이 울림ㅠㅠ

클래스 이름 여러 개 쓰기 복잡할땐

<div className={clsx(styles.modal, { [styles.openModal]: Boolean(open) })}>
import cx from "classNames"
<div className={cx('class1','class2')}></div>

git에서 branch 생성하는법

  • fork 한 뒤 원본으로 push는 모르겠다 그동안 이정도(10명) 규모로 협업할 일이 없었다구요ㅠㅠ 안되서 걍 원본을 clone함
  • vscode 터미널 열어서 하는게 속편하다
git init
git remote add origin 주소
git pull origin develop
git branch -m master develop
git branch feature/내역할
git checkout feature/내역할

git remote-v로
원본 저장소 이름과 fork 저장소 이름 확인 좀 하자....


중간에 한번 날려먹어서...자동저장하는 거 같았는데 안하네...? 모래를 핀셋으로 한알한알 줍는 느낌이다ㅠㅠ 바구니로 모래를 퍼담는 그날까지 가보자구😭

0개의 댓글