Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 21, 2020 23:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/b6a864d288c5c9a42195ec180af78b2b to your computer and use it in GitHub Desktop.
Save parzibyte/b6a864d288c5c9a42195ec180af78b2b to your computer and use it in GitHub Desktop.
async componentDidMount() {
// Obtener ID de URL
const idVideojuego = this.props.match.params.id;
// Llamar a la API para obtener los detalles
const respuesta = await fetch(`${Constantes.RUTA_API}/${idVideojuego}`);
const videojuego = await respuesta.json();
// "refrescar" el formulario
this.setState({
videojuego: videojuego,
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment