import styled from 'styled-components'; // 기본 스타일 const Button = styled.button` background-color: ${(props) => (props.primary ? 'blue' : 'green')}; color: ${props => props.color || 'black'}; /* props로 전달된 color 값이 없으면 기본값은 검정색 */ padding: 10px; border: none; `; // 예제에서 사용할 컴포넌트 const MyComponent = () => { return ( {/* primary prop이 true인 경우 파란색 배경, 그렇지 않으면 녹색 배경 */} Primary Button Secondary Butt..
// eslint-disable-next-line react-hooks/exhaustive-deps 추가 // 예시 useEffect(() => { calcSumApplication(); // eslint-disable-next-line react-hooks/exhaustive-deps }, [allApplication]);
모든 시간 두자리로 만들기 ////////// 현재 시간 반환 함수(모든 수 두자리) const currentTime = () => { // 현재 시각을 나타내는 JavaScript Date 객체 생성 const t = new Date(); // 년, 월, 일, 시, 분, 초 추출 const year = t.getFullYear(); const month = String(t.getMonth() + 1).padStart(2, "0"); // 월은 0부터 시작하므로 1을 더하고, padStart로 두 자리로 만듭니다. const day = String(t.getDate()).padStart(2, "0"); // 일도 padStart로 두 자리로 만듭니다. const hours = String(t.getHou..
arr="01012345678" replaceArr = arr.replace(/(\d{3})(\d{4})(\d{4})/, "$1-$2-$3"); console.log(replaceArr); //010-1234-5761 반환
props로 함수 전달하기(매개변수x) //부모 컴포넌트 import React from "react"; import Child from "./Child"; const Parent = () => { // props로 전달할 함수 const testFunc = () => { console.log("addArticle 함수 호출"); }; return ; }; export default Parent; // 자식 컴포넌트 import React from "react"; const Child = ({ propsFunc }) => { return ( // 버튼 클릭 시 부모 컴포넌트의 testFunc 함수 호출 Add Article ); }; export default Child; props로 함수 전달하기(매개..
//렌더링 ; // 스타일 밑 컴포넌트 const PromotionContainer = styled.div` background-color: #4d207a; width: 100%; height: 150px; display: flex; flex-direction: column; justify-content: center; `; const SlideTextContainer = styled(PromotionContainer)` overflow-x: hidden; display: flex; flex-direction: column; `; const SlideText = styled.div` white-space: nowrap; `; const MotionSlideText = ({ direction, text }..
https://www.hanl.tech/blog/vs-code-react-time-awesome-snippets/
1. 도메인 구매아래 링크에서 도메인을 구매한다.( 링크 -> 도메인 -> 도메인 검색) https://domain.gabia.com/regist/regist_domain구매 완료 후 My 가비아 -> 도메인 에서 표시한 도메인 주소를 복사한다 2. DNS 설정 변경my 가비아 -> 도메인 -> DNS 관리툴 -> 설정 -> DNS 설정 -> 레코드 수정 위 사진과 같이 변경 후 저장한다. (아래 복붙)A@76.76.21.21CNAMEwwwcname.vercel-dns.com. 3. Vercel 프로젝트 설정 변경Vercel -> 프로젝트 클릭 -> Settings -> Domain1번 과정에서 복사한 도메인 주소를 붙여넣기 한다.([ The specified value " soonting.si..