typescript3 Fetch in TypeScript 원본 : https://www.delftstack.com/howto/typescript/typescript-fetch/ Fetch in TypeScript The fetch is a globally available native browser function that can be used to fetch resource over an HTTP connection. In TypeScript, we can use the fetch function to consume typed response data. www.delftstack.com // Todo type interface interface Todo { userId: number; id: number; title: string; completed: boo.. 2022. 9. 4. antd useRef current.focus // const inputRef = useRef({}); // const inputRef = useRef({}); type RefType = { [key : string] : HTMLElement} const inputRef = useRef({}); const register = ((elem: any) => { const key = elem?.input?.id || elem?.props?.id || elem?.resizableTextArea?.props?.id; console.log('register', elem, key); return inputRef.current[key] = elem; }); const msgAlert = (msg: string, id: string) => { // a.. 2022. 6. 14. typescript onchange moment const handleChange = ({ target }: { target: HTMLInputElement | { name: string, value: moment.Moment | string | null } }) => { const { name, value } = target; // if (target instanceof HTMLInputElement) { // } else { // } // moment.isMoment(value); console.log(name, value); setData({ ...data, [name]: value }); }; 2022. 6. 12. 이전 1 다음