| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
- 접근자 함수
- 로지텍 MX Vertical 마우스
- vscode 초기화
- Object for in
- javascript cookie 얻기
- forEach map 차이
- javascript cookie 설정
- vue scss
- 검색창 autofocus
- next.config.mjs
- input range
- setter 함수 동기적 실행
- vue sass 사용하기
- for in for of 차이점
- react input autofocus
- vue scss 전역 설정
- pip 명령 에러
- 로컬스토리지 쓰기 읽기 삭제
- for in 문 예시
- 로컬스토리지 객체 저장
- array method 요약
- input type="range"
- input range 컬러변경
- vscode 재설치
- 접근자 프로퍼티
- for of 문 예시
- 로지텍 버티컬 마우스 사용 후기
- react 검색 기능 구현
- 객체 반복문
- javascript cookie 삭제
- Today
- Total
목록Web Development/React (15)
짬짬이기록하기
아래의 경우 count가 3씩 증가한다. // setter함수에 매개변수로 함수를 지정하면 함수가 끝날때까지 대기함. 동기적으로 처리된다. const syncIncrement = () => { setCount((count)=>count+1) setCount((count)=>count+1) setCount((count)=>count+1) }
반갑습니다. 컴포넌트 body const PropBody = (props) => { return ( {/* 상위에서 컴포넌트 body에 추가한 문자열은 자동으로 prop.children에 들어간다. */} {props.children} {/* props.children : 반갑습니다. 컴포넌트 body */} ) }
npm install styled-components import styled from 'styled-components' // 상위가 props로 전달하는 값을 이용해 동적 스타일링 적용 컴포넌트 const Footer = (props) => { // div는 div 컴포넌트를 만드는 함수이다. `` 부분은 div 함수 호출하면서 전달하는 매개변수 // 동적 스타일링이 적용된 div컴포넌트를 만들자. const FooterBox = styled.div` position: absolute; right: 0; bottom: 0; left: 0; padding: 1rem; background-color: ${() => (props.theme === 'basic' ? 'skyblue' : 'yellow')};..
* 소프트웨어 아키텍쳐 모델 : 관심의 분리 ## MVC (Model, View, Controller) : 역할 별로 분리하여 개발 * 주 목적 : 화면이 주목적인 소프트웨어 개발에 적용 * Model : 비지니스 업무 로직과 데이타 * View : 프리젠테이션 로직(화면) * Controller : 제어 * express, spring ==> MVC 적용 * express(node기반의 백엔드앱의 Controll을 위한 프레임워크) * 동적 UI 컴포넌트를 만들기 위한 프레임웍 : angular,vue,react * react : View를 중심으로 한 프론트앱의 프레임워크, 동적 데이터을 반영하는 대규모 웹앱 구축을 위해 만들어짐 # React 소개 - html이 화면당 여러개 일때, 각각이 html..
import { useState, useEffect, useRef } from 'react' import { useNavigate } from 'react-router-dom' import axios from 'axios' // 검색창 const focusRef = useRef() const [searchClassName, setSearchClassName] = useState('search_input d-none') const [keyword, setKeyword] = useState('') const searchProduct = async ()=>{ setSearchClassName('search_input d-none') setKeyword('') const resp = await axios.get..
front import { useEffect, useState } from "react"; import axios from "axios"; import { Link } from "react-router-dom"; const ProductListPage = () => { const perPageItemNum = 3 // 한 페이지에 보여줄 항목 개수 const perGroupPageNum = 5 // 한 그룹에 보여줄 페이지 개수 //상태.. const [pageState, setPageState] = useState({ totalCount: 0, //전체 항목 개수 totalPageCount: 0, //전체 페이지 개수 totalGroupCount: 0, //전체 그룹 개수 currentPage: 1, ..
1. useRef 선언 import { useRef, useEffect } from 'react' const focusRef = useRef() 2. 해당하는 input에 ref 추가 3. 포커싱이 일어나야 하는 라이프사이클에서 focus() useEffect(()=> { if (searchClassName === 'search_input d-block') { focusRef.current.focus() } }, [searchClassName]) ==> 검색창 레이어가 뜨는 상황을 searchClassName 상태데이터로 (d-none, d-block) 제어했고, 상태데이터가 d-block일 때 포커싱이 되도록 처리했다.