Useref con dattiloscritto valore impostato

Esempi di codice

0
0

useref dattiloscritto

import { useRef, useLayoutEffect } from "react";

//HTMLInputElement || define the type of element
const element = useRef<HTMLInputElement>(null);

useLayoutEffect(() => {
//object can be null
  if (element.current !== null) {
    element.current.focus();
  }
});

Pagine correlate

Pagine di esempio simili

In altre lingue

Questa pagina è in altre lingue

Русский
..................................................................................................................
English
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................