🌌 React 입문 13 - Component 간 State 공유
📘 『소플의 처음 만난 리액트』를 읽고 정리한 글입니다. Component 간 State 공유란? 어떤 Component의 State를 여러 개의 하위 Component에서 공통적으로 사용하는 것을 의미한다. 실습 Calculator.jsx ├── BoilingVerdict.jsx └── TemperatureInput.jsx 실습 ...
📘 『소플의 처음 만난 리액트』를 읽고 정리한 글입니다. Component 간 State 공유란? 어떤 Component의 State를 여러 개의 하위 Component에서 공통적으로 사용하는 것을 의미한다. 실습 Calculator.jsx ├── BoilingVerdict.jsx └── TemperatureInput.jsx 실습 ...
문제 Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). 입출력 예제 ✅ 예제 1 Input: root = [1,2,2,3,4,4,3] Output: true ✅ 예제 2 Input: root ...
📘 『소플의 처음 만난 리액트』를 읽고 정리한 글입니다. Form이란? Form은 사용자로부터 입력을 받기 위해 사용한다. HTML의 Form은 Element 내부에 각각의 상태가 존재한다. 반면 React의 Form은 Component 내부에서 State를 통해 데이터를 관리한다. ✅ HTML의 Form <form> ...
문제 Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes ...
📘 『소플의 처음 만난 리액트』를 읽고 정리한 글입니다. List와 Key List는 같은 유형의 아이템을 순서대로 모아 놓은 것이다. List를 구현하기 위해 Javascript의 변수나 객체를 하나의 변수로 묶어 놓은 것을 배열이라고 한다. Key는 각 객체나 아이템을 구분할 수 있는 고유한 값을 의미한다. map() funct...
문제 Given the root of a binary tree, return the inorder traversal of its nodes’ values. 입출력 예제 ✅ 예제 1 Input: root = [1,null,2,3] Output: [1,3,2] ✅ 예제 2 Input: root = [1,2,3,4,5,null,8,null,...
문제 You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively. Merge nums1...
📘 『소플의 처음 만난 리액트』를 읽고 정리한 글입니다. 조건부 렌더링이란? 조건에 따라 렌더링이 달라지는 걸 의미한다. 여기서 조건은 프로그래밍 언어에서 보통 일컫는 조건문을 의미한다. Inline 조건이란? 조건문을 코드 안에 집어넣는 것을 의미한다. ✅ Inline-if function Mailbox(props) { co...
P6Spy 도입 근거 코드에서 DB 접근 시 SQL문이 예상대로 실행되는지 확인하기 위함 WHERE 조건에 예상한 값이 들어갔는지 Lazy Loading이 예상치 않게 여러 번 발생했는지(N+1) 특정 조회가 너무 느린 건 아닌지 의존성 주입 /* p6spy */ implementatio...
문제 Given the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well. 입출력 예제 ✅ 예제 1 Input: head = [1,1,2] Output...