분류 전체보기349 728x90 Next.js #Image src - External CDN image is not visible Next.js src 에 외부 CDN(External) 정보를 넣으니 이미지 출력이 안되었다. 출력 방법은 간단하다. Image loader 를 사용하면 된다. import Image from 'next/image' const myLoader = ({ src, width, quality }) => { return `https://example.com/${src}?w=${width}&q=${quality || 75}` } const MyImage = (props) => { return ( ) } https://nextjs.org/docs/api-reference/next/image#loader next/image | Next.js Enable Image Optimization with the built-i.. 2022. 10. 6. React #Redux What Is Cross-Component / App-Wide State? Local State State that belongs to a single component E.g. listening to user input in a input field; toggling a "show more" details field Should be managed component-internal with useState() / useReduce() Cross-Component State State that affects multiple components E.g. open/ closed state of a modal overlay Requires "props chains" / "prop drilling" App-Wi.. 2022. 9. 24. React #Building Custom Hooks What are "Custom Hooks"? Outsource stateful logic into re-usable functions Unlike "regular functions", custom hooks can use other React hooks and React state The name must start with 'use' Sample Code src/hooks/use-http.js import { useState, useCallback } from 'react'; const useHttp = () => { const [isLoading, setIsLoading] useState(false); const [error, setError] useState(null); const sendReque.. 2022. 9. 24. React #Rules of Hooks React Rules of Hooks Only call React Hooks in React Functions React Component Functions Custom Hooks Only call React Hoos at the Top Level Don't call them in nested functions Don't call them in any block statements + extra, unoffical Rule for useEffect(): ALWAYS add everything you refer to inside of useEffect() as a dependency useEffect(() => { setFormIsValid(email && password) }, [email]); // (.. 2022. 9. 24. React #Understanding useReducer() useReducer() const [state, dispatchFn] = useReducer(reducerFn, initialState, initFn); state: The state snapshot used in the component re-render/ re-evaluation cycle dispatchFn: A function that can be used to dispatch a new action (i.e. trigger an update of the state) reducerFn: (prevState, action) => new State / A function that is triggered automatically once an action is dispatched (via dispatc.. 2022. 9. 24. 『생각이 너무 많은 서른 살에게』를 읽고 기억에 남는 3가지 1. 우물안 개구리 2. 고민보단 실천을 3. 회사는 연인과 같다 우물안 개구리 영어로 고통받았던 저자는 구글을 다니며 자신이 우물안 개구리라고 생각했지만 알고 보니 생각보다 많은 우물안 개구리들이 존재했다고 한다. 저자의 용기 있는 개구리 커밍아웃을 통해 다른 개구리들도 커밍아웃을 할 수 있었던 것이다. (자세한 내용은 스포라 생략했다) 어쩌면 우물안 개구리가 아닌 사람은 없을 것이다. 사람이 할 수 있는 일은 한정적이고, 수명의 한계가 존재한다. 그렇다고 우물을 벗어나거나 우물 크기를 키우려는 노력을 하는 것이 바보같은 짓일까? 아니라고 생각한다. 그렇지만 그 노력의 과정에 분명 외롭고 힘든 순간들을 마주하게 될 것이다. 그 때 나와 같은 개구리가 많다는 것을 알고 있다면 많은 위.. 2022. 7. 17. 프로그래머스 #2021 KAKAO BLIND -신규 아이디 추천 lv1 문제 풀이 function solution(new_id) { let answer = ''; answer = getAvailableId(new_id); return answer; } function getAvailableId(id) { let recommandId = '' const idInValidRe = /[^-_.a-z0-9]/g; const doubleDotRe = /\.{2,}/g; const startDotRe = /^\./; const endDotRe = /\.$/; // 1단계 new_id의 모든 대문자를 대응되는 소문자로 치환합니다. recommandId = id.toLowerCase(); // 2단계 new_id에서 알파벳 소문자, 숫자, 빼기(-), 밑줄(_), 마침표(.)를 제외한 모.. 2022. 7. 4. TFT 팬아트 #짜릿짜릿 키키와 배불뚝이 꼬마전설이 6h ipad pro + procreate 참고한 이미지 - 짜릿짜릿 키키와 배불뚝이 꼬마전설이 2022. 7. 2. javascript #자바스크립트 객체와 SOLID 원칙 자바스크립트 객체와 SOLID 원칙 원시형 객체 리터럴 모듈 패턴 객체 프로토타입과 프로토타입 상속 new 객체 생성 클래스 상속 함수형 상속 멍키 패칭 1. 자바스크립트 원시형 (Primitive Type) JavaScript에서 원시 값(primitive, 또는 원시 자료형)이란 객체가 아니면서 메서드도 가지지 않는 데이터다. 원시 값에는 7종류, string, number (en-US), bigint (en-US), boolean, undefined, symbol, 그리고 null이 존재한다. 대부분의 경우, 원시 값은 언어 구현체의 가장 저급(low level) 단계에서 나타낸다. 모든 원시 값은 불변하여 변형할 수 없다. 원시 값 자체와, 원시값을 할당한 변수를 혼동하지 않는 것이 중요하다. .. 2022. 5. 29. [VRChat] 화면 해상도 높이기 (그래픽 퀄리티 높이기) 이 방법은 이제 안돼요. 이전에는 Ctrl을 누르며 VRChat 을 켜거나 Shift 를 누르며 Steam에서 실행하면 해상도 설정 화면이 출력되었다고 합니다. 하지만 이제 작동하지 않습니다. VRChat 문서로 확인된 그래픽 퀄리티 높이기 가이드 문서이니 아래를 참고하셔서 본인 해상도에 맞는 VRChat을 즐기시길 바랍니다. 가이드 요약 1) 효과 모두 켜기 : Settings > Safety > Shild Level None 2) 아바타 퍼포먼스 높이기 : Settings > Safety > Performance Options > Avatar Perf. > Medium^ 3) 아바타 물리 모션 퍼포먼스 높이기 : Settings > Safety > Performance Options > Dynamic.. 2022. 2. 7. 728x90 이전 1 2 3 4 5 6 7 ··· 35 다음 728x90