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

262
Views
TypeError no detectado: el producto no está definido No se puede acceder a la identificación de usuario de mi producto TypeError no detectado: no se pueden leer las propiedades de undefined (leyendo '_id')

Estoy tratando de establecer un enlace dependiendo de si un usuario creó la publicación o no, si la creó, entonces aparece un botón EDITAR, de lo contrario, aparece un informe.

 const userLogin = useSelector((state) => state.userLogin) const { userInfo } = userLogin const productDetails = useSelector (state => state.productDetails)

const {cargando, error, producto} = detalles del producto

 useEffect(() => { dispatch(listProductDetails(id)) dispatch(listProducts()) }, [dispatch, id]) const [bid, setBid] = useState('') const submitHandler =(e) => { e.preventDefault() if (setBid > product.currentPrice + product.minIncrement){ dispatch(makeBid({bid, _id: id})) }else { console.log("Bid isn't big enough") } } return ( <> <Link className='btn btn-dark my-3' to='/'>more</Link>

el problema es aqui no puedo acceder a mis datos

 {userInfo ?(userInfo.id===product._id&&( <Link className='ml-19' to={`/product/${product._id}/edit`}>EDIT</L`enter code here`ink> )) :userInfo?(userInfo.id !== product._id&&( <Link to={`/product/${product._id}/report`}>REPORT</Link> )): (<></>)} {loading ? <Loader /> : error ? <Message variant='danger'>{error}</Message> : ( <> <Meta title={product.name} /> <Row> <Col md={4} > <Link className='link' to={`/profile/${product._id}`}> <h5>Listing created by</h5> <h6>{/*product.user.name*/}</h6> </Link> <Image className='border border-primary' src={product.image} alt={product.name} fluid/> ....
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!