/componentDidMount.js Secret
Created
December 21, 2020 23:25
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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