Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

73
Vistas
Property 'X' is missing in type 'DefaultRootState' - but the property is declared in Interface

Here's my Interface which I'm using with mapStateToProps:

export interface IStore {
  cache?: any;
  dataManager?: IUR;
  userPrefs: IUP;
  IModal?: IfingerprintModal;
}

export interface IModal {
  cbCancel: IFModalFn | null;
  cbTryAgain?: IFModalFn | null;
  error: null | string;
  success: boolean;
  visible: boolean;
}

Here's the mapStateToProps fn expression:

const mapStateToProps = (state: IStore) => ({
  store: {
    IModal: state.userPrefs.IModal,
  },
});

And here's the connect HOC:

export default connect<IStore,{}>(mapStateToProps, mapDispatchToProps)(IModal);

That's the error I'm seeing: enter image description here

I can get rid of the problem by:

export default connect<IStore>(mapStateToProps as any, mapDispatchToProps)(IModal);

But I am trying to find a generic solution to that

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Just remove the type from the connect call and let typescript to handle it for you:

connect(mapStateToProps, mapDispatchToProps)(FingerprintModal);

Otherwise you would need to specify the full type:

connect<{store: IStore;}, {}, {}, IStore>(mapStateToProps, mapDispatchToProps)

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda