
최근 react를 하며 생명 주기에 대해서 고민을 많이 하고있다. 좀더 사용자 친화적으로 화면을 꾸미기 위해서는 이런 부분을 확실히 알기 위해서다 다행히 검색을 하던 도중 https://github.com/donavon/hook-flow GitHub - donavon/hook-flow: A flowchart that explains the new lifecycle of a Hooks component. https://dwe.st/hf A flowchart that explains the new lifecycle of a Hooks component. https://dwe.st/hf - GitHub - donavon/hook-flow: A flowchart that explains the new lifec..
SvelteKit를 개발하다 다시 Next와 React로 넘어오면서 기존의 데이터를 저장하는 법이 따로 없어 검색을 계속 해봤지만 딱히 나오지 않아서 hook을 하나 만들게 되었다. import { Dispatch, SetStateAction, useEffect, useState } from "react"; export default function useCapture(key: string, initialState: S): [boolean, S, Dispatch] { const [loading, setLoad] = useState(false) const [get, set] = useState(initialState) useEffect(() => { if (typeof window !== 'undefine..