전체 글476 Axios in Typescript 원본 : https://bobbyhadz.com/blog/typescript-http-request-axios 2022. 9. 4. 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. 화면 활성화 비활성화 active deactive , visibilitychange document.addEventListener('visibilitychange', function() { if (document.hidden) { if ( handleInterval > 0 ) clearInterval(handleInterval); } else { if ( handleInterval > 0 ) clearInterval(handleInterval); console.log("============== ACTIVE ============="); handleInterval = setInterval(()=>{ },intervalTime); } }, false); 2022. 8. 19. 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. react class componet import React from 'react'; import ReactDOM from 'react-dom'; class Toggle extends React.Component { constructor(props) { super(props); this.state = { toggle : false }; this.handleClick = this.handleClick.bind(this); } handleClick() { // todo this.setState({ toggle : this.state.toggle?false:true }); } render() { return ( {this.state.toggle?"ON":"OFF"} ); } } ReactDOM.render( , doc.. 2022. 4. 4. 이전 1 2 3 4 5 6 7 ··· 80 다음