일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Interface
- CSS
- Ethereum
- evm
- typeScript
- concept
- error
- 기준
- API
- bitcoin
- Redux
- Props
- express.js
- solidity
- hardhat
- graphQL
- HTML
- CLASS
- SSR
- 삶
- useState
- web
- node.js
- JavaScript
- blockchain
- tailwindcss
- built in object
- middleware
- nextJS
- REACT
- Today
- Total
목록Frontend/Typescript (21)
ReasonJun
https://www.daleseo.com/zod-schema/ Zod를 통한 타입스크립트 친화적인 스키마 정의 Engineering Blog by Dale Seo www.daleseo.com
reference : https://kentcdodds.com/blog/wrapping-react-use-state-with-type-script Wrapping React.useState with TypeScript Stay up to date Subscribe to the newsletter to stay up to date with articles, courses and much more! Learn more Stay up to date Subscribe to the newsletter to stay up to date with articles, courses and much more! Learn more All rights reserved © Kent C. D kentcdodds.com
The "not assignable to parameter of type never" error in TypeScript occurs when you try to assign a value of a type that is not never to a parameter of type never. The never type is a special type in TypeScript that represents a value that can never occur. This means that any attempt to assign a value of type never to a parameter of type never will result in an error. For example, the following ..
If typescript cannot infer the type and need to do type annotation 1. In case of unilaterally returning any type const json = '{"x": 1, "y": 2}'; const coordinates = JSON.parse(json); console.log(coordinates); 2. If you declare a variable first and initialize it later => In this case, it is inferred as any. let greeting greeting = 'hello' // let greeting: any 3. When the value to be assigned to ..
The void type is used to represent functions that do not return a value. This is typically used for functions that have side effects, such as logging or printing to the console. For example: function logMessage(message: string): void { console.log(message); } const result = logMessage("Hello, world!"); // The result of this function is void The never type is used to represent functions that neve..
In TypeScript, an enum is a special "class" that represents a group of constants (unchangeable variables). Enums come in two flavors string and numeric. enum means enumerated type. An enum names a set of values and makes them available. Here we can utilize an enum to use a set called PrintMedia with a friendly name instead of a hard-to-remember number. Each PrintMedia enumerated is zero-based by..