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

352
Views
Argumento de tipo '{identificador: cadena; }' no se puede asignar al parámetro de tipo 'ConcatArray<never>'

Soy nuevo en mecanografiado, aquí he estado agregando mecanografiado a mi proyecto, obteniendo este extraño error: No overload matches this call. Overload 1 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error. Argument of type '{ identifier: string; }' is not assignable to parameter of type 'ConcatArray<never>'. Type '{ identifier: string; }' is missing the following properties from type 'ConcatArray<never>': length, join, slice Overload 2 of 2, '(...items: ConcatArray<never>[]): never[]', gave the following error. Argument of type '{ identifier: string; }' is not assignable to parameter of type 'ConcatArray<never>'.ts(2769)

mi código donde me está dando eso (reducers.ts):

 interface Update_AnalyserState { identifier: string; } const initialArticleState= { analysers: [], }; export function articleReducer( state = initialArticleState, action: articleReducerAction ) { switch (action.type) { case ActionType.UPDATE_ANALYSER: return { ...state, analysers: state.analysers .filter( (a: Update_AnalyserState) => a.identifier != action.payload.identifier ) .concat(action.payload), }; } }

alguna ayuda/sugerencia con esto?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No es fácil depurar a partir de su ejemplo, pero creo que el problema es este

 const initialSiteArticleState = { analysers: [], };

Sus analizadores son un tipo de matriz vacía, por lo que significa que never[] . Entonces, el resultado del filtro será never[] . Por lo tanto, deberá escribir correctamente ese initialSiteArticleState .

Algo como

 const initialSiteArticleState:{analysers: Update_AnalyserState[]} = { analysers: [], };

Dale un tiro. Aquí también hay un patio de recreo en el que traté de reproducir su código. Si pasa el cursor sobre tmp , puede ver que es de tipo never[] .

about 4 years ago · Juan Pablo Isaza 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!