soso-tip
soso-tip copied to clipboard
๐ฏ์์ํ ํ๋ค๊ณผ ์ ๋ฆฌ, ๋ฒ๊ทธ ํด๊ฒฐ๊ธฐ๋ฅผ ๋ชจ์๋๋ ๋ ํฌ
react-hook-form์ ๋์๋ฐฉ์์ HTML Element๋ฅผ ๋ด๋ถ `ref`๋ก ๊ด๋ฆฌํ๋ ๋ฐฉ์์ด๋ค. ```tsx // useForm 'register'ํจ์์ ๋ง์ง๋ง ๋ถ๋ถ return (ref: (TFieldElement & Ref) | null) => ref && registerFieldRef(ref, refOrRegisterOptions); // input์ ref๋ฅผ attachEventListeners...
user snippet ํ์ผ ์ด๋ฆ์ ๊ธฐ์ค์ผ๋ก `export default function ํ์ผ์ด๋ฆ()`๊น์ง ์์ฑํด์ค ```json { "export default function": { "scope": "javascript,typescript, typescriptreact", "prefix": "edf", "body": [ "export default function $TM_FILENAME_BASE()", ], "description": "export...
## Desc ![image](https://user-images.githubusercontent.com/18658235/124349175-e3961b00-dc28-11eb-8c01-2718f031925d.png) [AnimateSharedLayout](https://www.framer.com/api/motion/animate-shared-layout/)์ ์ธ๋ ์ ์ฒ๋ผ animation์ด ๊ฑธ๋ฆฐ ์ปจํ ์ธ ์ width๊ฐ ํ๋ค๋ฆฐ๋ค๋ฉด `layout="position"`์ผ๋ก position ๋ณํ์๋ง ์ ๋๋ฉ์ด์ ์ด ์ ์ฉ๋๋๋ก ํ์.
```diff module.exports = { presets: [ [ 'next/babel', { 'preset-react': { runtime: 'automatic', - importSource: '@emotion/react', }, }, ], ], - plugins: ['@emotion/babel-plugin', 'babel-plugin-macros'], } ``` ๋ ์ค์ ์ด ์์ผ๋ฉด [stitches์...
postcss 8์ด ๋ฆด๋ฆฌ์ฆ๋๋ฉด์ ๋ํ๋์๊ฐ ์ฌ๊ธฐ์ ๊ธฐ ์ข ์ข ..๊นจ์ง.. ํนํ ์นํฉ4 ๋ชจ๋๋ก ๋๋ฆฌ๋ฉด ์ต์ ๋ํ๋์์ ๊ฑฐ์ง ํธํ์ด ์๋๋๋ฐ.. - `@storybook/addon-postcss`๋ก postcss๋ฒ์ ์ ํจํค์ง ๋ฒ์ ์ผ๋ก ์จ์ฃผ๊ณ - storybook/scss๋ฅผ ์ฌ์ฉํด์ฃผ๊ณ - (if yarn2) ์์กด์ฑ์ ์ข ๋ช ์ํด์ฃผ๋ฉด...
// ๋ด์ฉ ๋ณด์ถฉ ์ค 6๊ฐ์ form(Controller + ๋จ์ input)์ผ๋ก ์ด๋ค์ง field group์ fieldArray๋ก ๋ค๋ฃฐ ๋ ๋ค์๊ณผ ๊ฐ์ ํผํฌ๋จผ์ค ์ ํ๊ฐ ๋ฐ์ํ๋ค. ![image](https://user-images.githubusercontent.com/78015010/112751630-f4236d80-9009-11eb-8c89-abedeaab06f2.png) ## Problem `register({ required: isRequired && '์๋ฌ๋ฉ์ธ์ง' })` ์ฝ๋๋ก...
# cache clear์๋ ๋ ```tsx import React, { ReactNode } from 'react'; import { SWRConfig } from 'swr'; /** * @description https://github.com/vercel/swr/pull/231#issuecomment-591614747 */ const SWRNoCache = ({ children }: { children:...
jest์์ esm์ ์ง์ํ์ง ์์์ ์๊ธฐ๋ ์ด์ (์ง์ ํ๋ ค๊ณ ์คํ์ค) test env์์ modules: auto์ฃผ๋ฉด esm์ผ๋ก ๋ณํ์๋์ด์ jest์คํ์ด ๊ฐ๋ฅํ๋ค. ```js module.exports = { plugins: [ ], presets: [ ['@babel/preset-env', { 'modules': false...
## [wip] isSuccess ๊ถ๊ธํ ์ : https://react-query.tanstack.com/docs/api ์์ `onSuccess`์ฝ๋ฐฑ๋ ์๊ณ , `isSuccess`๋์๋๋ฐ ๋ ๊ฐ์ ์ฐจ์ด๋ ํ์ด๋ฐ์? ๋จ์ํ DX? [์ด ๋ถ๋ถ์ ์ฝ๋](https://github.com/tannerlinsley/react-query/blob/00b9e968a80ca7c51fd50479aee852bb41bf9bc6/src/react/useMutation.ts#L151-L156)๋ฅผ ๋ณด๋ ํ์ด๋ฐ์ `onSuccess`์ฝ๋ฐฑ์ด ๋จผ์ ๋ถ๋ฆด๊ฒ ๊ฐ๋ค. ์ดํ์ `isSuccess`๊ฐ์ด true๊ฐ ๋์ง ์์๊น....
## Desc react-transiton group์ผ๋ก BottomSheet๋ฑ์ ๋ง๋ค ๋ Lottie๋ฆฌ์์ค๊ฐ ์์ ์ฌ๋ผ์ก๋ค๊ฐ ๋ค์ ์๊ธฐ๋ ๋ฑ์ ์ด์๊ฐ ์์ ์ ์๋ค. lottie์์ญ์ ๊ณ ์ height๋ฅผ ์ค๊ฒฝ์ฐ ๋ฆฌ์์ค๊ฐ ์์ ์ฌ๋ผ์ง์ง๋ ์์ง๋ง, ์ ๋๋ฉ์ด์ ์ด ์ ์ง๋ ์ฑ๋ก bottom sheet๊ฐ...