input; // 선언
inputRef = (c) => {
this.input = c;
}
this.inputRef.focus()
<Tag ref={this.inputRef}>
inport React, { createRef } from 'react'
inputRef = createRef()
this.inputRef.current.focus()
<Tag ref={this.inputRef}>
import React, { useRef } from "react";
const inputRef = useRef();
inputRef.current.focus();
<Tag ref={inputRef}>
예 )
const timeout = useRef(null);
const startTime = useRef(0);
timeout.current = setTimeout(() => {} // setTimeout저장
startTime.current = new Date();