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

182
Views
ts(2322) La propiedad secundaria no existe en el tipo 'Atributos y accesorios intrínsecos'

Recibo el siguiente error al intentar crear un mapa múltiple con 'fecha' como clave y luego iterar a través del mapa múltiple que tiene matrices como valores.

Escriba '{hijos: nunca[]; clave: cadena; Índice: cadena; Elemento: AlgúnElemento[]; }' no se puede asignar al tipo 'IntrinsicAttributes & Props'. La propiedad 'hijos' no existe en el tipo 'IntrinsicAttributes & Props'. (2322)

y no estoy seguro de cómo arreglar esto

 const History = () => { const [counter, setCounter] = useState(0); type SomeMap = Map<string, SomeItem[]>; let map: SomeMap = new Map(); //Items is of type SomeItem[] Items.foreach((item) =>{ if(map.has(item.date)){ (map.get(item.date) ?? []).push(item); } else{ map.set(item.date,[item]); } }); return( <Accordian> { map.foreach((value, index) => { setCounter(counter +1 ); <Task key={index} Index={counter.toString()} Item={value}> </Task> })} </Accordian> ); }; type Props = { index: string; Item: SomeItem[]; }; const Task = (props:Props) => { const index = props.Index; const Item = props.SomeItem; render(/*Some Code*/); };
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Task no está escrita para recibir elementos children , pero en realidad está pasando un nodo de texto de nueva línea como elementos secundarios de la tarea.

 <Task key={index} Index={counter.toString()} Item={value}>{/* there is a new line text node here */} </Task>

Probablemente desee hacer que la etiqueta JSX se cierre automáticamente para asegurarse de que no tenga hijos:

 <Task key={index} Index={counter.toString()} Item={value} />

Patio de recreo

over 4 years ago · Santiago Trujillo Report
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!