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

326
Views
Ejecutando "Error de tipo: no se pueden leer las propiedades de undefined (leyendo 'hasOwnProperty')" en las publicaciones de blog

Las publicaciones de mi blog se publican y se recuperan con éxito cuando sigo el enlace desde la página de mi blog; sin embargo, si copio el enlace y trato de seguirlo de forma independiente, aparece este error:
"TypeError: no se pueden leer las propiedades de undefined (leyendo 'hasOwnProperty')"

Construí el Blog siguiendo este tutorial: https://www.youtube.com/watch?v=F6uZB1yls6Q&list=PLc_uiDBU7n2rP-5wOAoMnCE_bAzMe8_ty&index=5

Aquí está mi código:

 class ViewArticle extends Component { constructor(props) { super(props); this.state={ article: {}, isLoaded: false } } componentDidMount() { if(this.props.location.state !== 'undefined') { if(this.props.location.state.hasOwnProperty('article')){ this.setState({ article: this.props.location.state.article }, () => { this.setState({ isLoaded: true }) }) } }else{ this.getArticleByID(this.props.match.param.id) } } getArticleByID = (aid) => { db.collection('Articles') .doc(aid) .get() .then(doc => { if(doc.exists){ this.setState({ article: doc.data() }, () => { this.setState({ isLoaded: true }) }) } else { this.props.history.push({pathname:'/'}) } }) }
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!