목록전체 글 (298)
\(@^0^@)/

Only call React Hooks in React Functions 반응 함수에서 반응 훅만 호출해야 함. ( React Component Functions 또는 Custom Hooks ) Only call React Hooks at the Top Level 반응 구성 요소 기능의 최상위 수준에서는 반응 훅만 호출해야 함. ( 중첩된 함수에서 훅 호출 X , 블록 문에서 호출 X ) unofficial Rule for useEffect( ) : always add everything you refer to inside of useEffect( ) as a dependency 항상 useEffect() 내부에서 참조하는 모든 항목을 항상 dependency array에 추가해야 함. (그렇게 하지 말..

useState( ) The main state management "tool" useState는 주요 상태 관리 도구 Great for independent pieces of state/ data 독립된 상태 및 데이터 조각에 적합 Great if state updates are easy and limited to a few kinds of updates 상태 업데이트가 쉬우면 좋음, 몇 가지 종류의 업데이트로 제한 됨. useReducer( ) : object가 state로 있는 경우, 또는 더 복잡한 상태 Great if you ned "more power" Should be considered if you have related pieces of state/ data 관련 데이터를 다루는 경우, ..

Q : Which value should you pass to event listener props like onClick? onClick과 같은 이벤트 리스너 소품에 어떤 값을 전달해야 하나? A : A pointer at the function that should execute when the event occurs. 이벤트가 발생할 때 실행되어야 하는 함수에 대한 포인터. + That's the correct choice - you want to pass a "pointer" at the to-be-executed function as a value to onClick etc. Then, this function gets executed "on your behalf" by React when th..