Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

298
Views
Reaccionar TypeError: indefinido no tiene propiedades

Estoy intentando seguir un tutorial pero cuando tengo que pasar los props me sale este error

TypeError: indefinido no tiene propiedades PokemonDetails.js:16

Estaba tratando de hacer un archivo console.log pero no puedo, no sé qué está mal.

 const PokemonCard = (props) => { const classes = useStyles(); const { pokemon, image } = props; const { id, name } = pokemon; return ( <Grid item xs={12} sm={2} key={id}> <Link to={"/pokemon/" + id} className={classes.link}> <Link to={"/pokemon/" + id}> <Card className={classes.card}> <CardMedia className={classes.cardMedia} image={image}></CardMedia> <CardContent className={classes.cardContent}> <Typography>{name}</Typography> </CardContent> </Card> </Link> </Link> </Grid> ); }
 export default class PokemonDetails extends Component { constructor(props){ super(props) this.state = { pokemon: null } } componentDidMount(){ const { match } = this.props const { id } = match?.params // error axios.get(POKEMON_API_URL + "/" + id).then((response) => { if (response.status >= 200 && response.status < 300) { console.log(response.data); this.setState({ pokemon: response.data }) } }) } render() { return ( <div style={{marginTop: 100}}>PokemonDetails</div> ) } }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!