useRef with Typescript
- tags:: Typescript
With crateRef
const myRef = createRef<HTMLDivElement>()
forwardref
type Ref = HTMLButtonElement
const F = forwardRef<Ref, Props>
or
type Ref = React.Ref<HTMLDivElement>
const myRef = createRef<HTMLDivElement>()
type Ref = HTMLButtonElement
const F = forwardRef<Ref, Props>
or
type Ref = React.Ref<HTMLDivElement>