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

219
Views
Error de mecanografiado: no se puede asignar al tipo 'IntrinsicAttributes'

He creado este componente TSX y me encuentro con un error.

 function FeedMain() { const posts = [ { id: "123", username: "danieljames", userImg: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Instagram_logo_2016.svg/768px-Instagram_logo_2016.svg.png", img: "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Instagram_logo_2016.svg/768px-Instagram_logo_2016.svg.png", caption: "This is AWWESOME", }, ]; return ( <> <div> {posts.map((post) => ( <> <FeedPost key={post.id} id={post.id}/> </> ))} </div> </> ); } export default FeedMain;

el error es:

Type '{ key: string; id: string; }' is not assignable to type 'IntrinsicAttributes'. Property 'id' does not exist on type 'IntrinsicAttributes'.

 FeedPost: function FeedPost({ key, id }) { return ( <> <h1 key={key}>{id}</h1> </> ); } export default FeedPost;

No estoy seguro de cómo cambiar la escritura para que TypeScript funcione con el método de mapeo. El error que ocurre es que al tipo '{}' le faltan las siguientes propiedades del tipo '{ clave: cualquiera; identificación: cualquiera; }': clave, identificación

Creo que necesito hacer que la escritura sea más específica, pero no estoy seguro de cómo hacerlo, ya que soy nuevo. ¡Cualquier sugerencia sería realmente bienvenida por favor!

¿Alguien tiene alguna sugerencia?

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!