본문 바로가기

web116

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.
Promise then 2021. 10. 1.
Placing the scroll bar on the top of the div element. The difference between the bottom position of the scroll-bar and the top position of the scroll-bar code has been highlighted. # https://www.geeksforgeeks.org/how-to-change-the-position-of-scrollbar-using-css/ GeeksforGeeks GeeksforGeeks is a Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes etc. 2021. 9. 21.
Google BigQuery ```sql CREATE TEMP FUNCTION rc( v FLOAT64, reverse BOOL) RETURNS FLOAT64 LANGUAGE js AS """ if ( reverse ) { return 5-v; } else { return v; } """; select p.HID, p.PYGENDERw2, avg(rc(cast(p.PPSY5A01w2 as FLOAT64),true ) + rc(cast(p.PPSY5A03w2 as FLOAT64),true ) + rc(cast(p.PPSY5A05w2 as FLOAT64),true ) + rc(cast(p.PPSY5A06w2 as FLOAT64),true )) / 4 as PM_1, avg(rc(cast(p.PPSY5A02w2 as FLOAT64),fa.. 2021. 3. 21.