728x90
๋ฐ˜์‘ํ˜•

TS 1

TS2367: This comparison appears to be unintentional because the types '"A"' and '"B"' have no overlap.

ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์‚ฌ์šฉํ•˜๋ฉด์„œ ๋ฐœ์ƒํ•œ ์—๋Ÿฌ์ž…๋‹ˆ๋‹ค. ๋ฌธ์ œ {(response === 'A' && response !== 'B' ? !show : loading) && ( Thinking )} &&์—ฐ์‚ฌ์ž๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๋‘ ๊ฐœ์˜ ์กฐ๊ฑด์„ ๊ฑธ์—ˆ๋Š”๋ฐ ์ œ๋ชฉ๊ณผ ๊ฐ™์€ ํƒ€์ž…์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ํ•ด๊ฒฐ๋ฐฉ์•ˆ {(response !== 'B' && response === 'A' ? !show : loading) && ( Thinking )} ๋‹จ์ˆœํžˆ ์ˆœ์„œ์˜ ์ฐจ์ด๋กœ ๋ณด์ž…๋‹ˆ๋‹ค. ์ €๋Š” ์›น์Šคํ†ฐ์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š”๋ฐ, ๊ฑฐ๊ธฐ์„œ ๋‚˜์˜ค๋Š” ํ•ด๊ฒฐ๋ฐฉ์•ˆ์œผ๋กœ ์œ„์™€ ๊ฐ™์ด ์ˆœ์„œ๋ฅผ ๋ฐ”๊พธ๋‹ˆ๊น ์—๋Ÿฌ๊ฐ€ ์‚ฌ๋ผ์กŒ์Šต๋‹ˆ๋‹ค. (vscode๋„ ๋˜‘๊ฐ™์„ ๊บผ๋ผ๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.) TypeScript์—๋Ÿฌ๋ผ ์‚ฌ์‹ค ๋™์ž‘ํ•˜๋Š” ๋ฐ๋Š” ์ƒ๊ด€์—†์ง€๋งŒ, build ํ•  ๋•Œ ์—๋Ÿฌ๋„ ๋‚  ํ…Œ๊ณ , TS์‚ฌ์šฉํ•˜๋Š”๋ฐ ๊ทœ์น™์„ ์ง€ํ‚ค..

728x90
๋ฐ˜์‘ํ˜•