참조: https://steemit.com/kr/@sanghkaang/3-0-why-the-web-3-0-matters-and-you-should-know-about-it
Cannot read properties of undefined (reading 'writer')
원하던 순서: 부모컴포넌트에서 data생성(비동기처리) -> 자식컴포넌트 props로 data전달 -> 자식컴포넌트 렌더링
문제: 자식컴포넌트 렌더링(props로 data(undefined상태)를 받아 사용) -> 에러!!
- data가 비동기로 데이터를 받아오면서 발생한 문제같다.
부모에서 data를 props를 통해 자식에게 보내면
자식이 필요한곳에 data를 사용해 렌더링해야하는데,
비동기로 인해 undefined인 상태로 부모가 data를 보내고,
자식이 그 데이터를 받아 사용해 렌더링하며 생긴 문제이다.
해결방법
구글링을 하다 찾아본 방법에는 Optional Chaining을 사용하는 방법을 썼더니, 잘 해결되었다.
Vue에서 이런 경우가 일어난 경우 : v-if를 사용하거나 3항연산자를 사용해야한다.
참고: vue에서는 nullish-coalescing-operator(??)와 optional-chaining(?.)을 template에서 쓸수 없다. 따로 설정해줘야한다.
dayjs 라이브러리 사용: momentjs보다 가벼워 사용 추천
error: The service worker navigation preload request was cancelled before 'preloadResponse' settled. If you intend to use 'preloadResponse', use waitUntil() or respondWith() to wait for the promise to settle. (공부 더 필요!)
defaultValue vs value (공부 더 필요!)
# Instead of git clone https://github.com/NAME/repo.git # try git clone https://username:password@github.com/NAME/repo.git ------------------------------------------------------------ # You can also use git clone https://username@github.com/NAME/repo.git #and git will prompt for the password (thanks to leanne for providing this hint in the comments).
https://stackoverflow.com/questions/25947059/git-clone-repository-not-found
위에 있는git clone https://username:password@github.com/NAME/repo.git
안되어서
깃허브가 최근 accesstoken을 사용하는걸 기억해서(스택오버플로우 질문&답변 기간이 오래되었다)
git clone https://username:accesstoken@github.com/NAME/repo.git
으로
시도하니 private레포가 clone되었다!!!