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

639
Views
El argumento de tipo '(dispatch: any) => Promise<void>' no se puede asignar al parámetro de tipo 'AnyAction'

Soy nuevo en Redux Toolkit, convertí mi código en eso y todo parece estar bien, pero el envío da un error:

El argumento de tipo '(dispatch: any) => Promise' no se puede asignar al parámetro de tipo 'AnyAction'.

Falta la propiedad 'tipo' en el tipo '(dispatch: any) => Promise' pero se requiere en el tipo 'AnyAction'.ts(2345)

Este es mi archivo store.ts :

Cambiar de Redux a Redux Toolkit

Pero con TypeScript agregué así:https://codesandbox.io/s/stoic-taussig-kl8jt?file=/src/store.ts

Código donde me sale ese error:

 const dispatch = useAppDispatch(); const loadGraph = () => { if (currentSite) { dispatch(getFloor(currentSite.identifier)).then(() => { console.log("Fetched floorplan"); dispatch(getGraph(currentSite.identifier)).then(() => { console.log("Fetched model", realGraph.model); if (currentCamera) { dispatch( changeActiveCamera( currentSite.identifier, currentCamera.identifier ) ); } }); }); } };

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!