Here's my Interface which I'm using with mapStateToProps
:
export interface IStore { cache?: any; dataManager?: IUR; userPrefs: IUP; fingerprintModal?: IfingerprintModal;}export interface IfingerprintModal { cbCancel: IFModalFn | null; cbTryAgain?: IFModalFn | null; error: null | string; success: boolean; visible: boolean;}
Here's the mapStateToProps
fn expression:
const mapStateToProps = (state: IStore) => ({ store: { fingerprintModal: state.userPrefs.fingerprintModal, },});
And here's the connect
HOC:
export default connect<IStore,{}>(mapStateToProps, mapDispatchToProps)(FingerprintModal);
I can get rid of the problem by:
export default connect<IStore>(mapStateToProps as any, mapDispatchToProps)(FingerprintModal);
But I am trying to find a generic solution to that