Skip to content

Instantly share code, notes, and snippets.

@nickrouty
Created August 3, 2021 16:42
Show Gist options
  • Save nickrouty/eb0afb434ca070ec0dd5428768125200 to your computer and use it in GitHub Desktop.
Save nickrouty/eb0afb434ca070ec0dd5428768125200 to your computer and use it in GitHub Desktop.
How to retrieve the native element underlying an IonInput component in React
const passwordInput = useRef<HTMLIonInputElement>(null);
passwordInput.current?.getInputElement().then( (element) => {
if ( element.value ) {
setPassword(element.value);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment