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

67
Views
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 answers
Answer question

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 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!