Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 19, 2020 18:13
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/c86128ec9bd72b3c1504cfd428c2bf20 to your computer and use it in GitHub Desktop.
Save parzibyte/c86128ec9bd72b3c1504cfd428c2bf20 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}/obtener_videojuego.php?id=${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