Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

property does not exist on type 'IntrinsicAttributes & Pick<any, symbol>' #213

Open
@Rey-Wang

Description

@Rey-Wang

I try to integration connect withredux-thunk, and overwrite connect function like this:

import*asReactfrom'react'import{connectasreactReduxConnect}from'react-redux'import{bindActionCreators,Dispatch,ActionCreatorsMapObject,}from'redux'/** * This is just a small wrapper around react-redux's connect function *@param  Component                The component you want to connect *@param  mapStateToProps          The "normal" mapStateToProps function *@param  mapActionCreatorsToProps A function that returns an object with the actions your component will call */exportdefaultfunctionconnect(Component:React.ComponentType<any>,mapStateToProps:(state:Object,ownProps:Object)=>Object,mapActionCreatorsToProps:(dispatch?:Dispatch<any>)=>ActionCreatorsMapObject=()=>({})// This default value is just a function that returns an empty object){returnreactReduxConnect(mapStateToProps,(dispatch:Dispatch<any>)=>bindActionCreators(mapActionCreatorsToProps(dispatch),dispatch))(Component)}

Then I use it like a usual connect

**interfaceIProps{testId:string;  haah:number;  getCharacters:Function;  setCharacter:Function;  searchCharacters:Function;  character:any;  characters:ICharacter[];  isFetching:Boolean;}// Note: This is mainly done to enable testingexportconstCharacterContainer:React.FunctionComponent<IProps>=({  testId,  getCharacters,  character,})=>{//render component};// Make data available on propsconstmapStateToProps=(store:any)=>{return{character:store.characterState.character,};};// Make functions available on propsconstmapDispatchToProps=(dispatch:any)=>{return{getCharacters:()=>dispatch(getCharactersStartActionCreator()),};};// Connect the app aware container to the store and reducersreduxConnectexportdefaultconnect(CharacterContainer,mapStateToProps,mapDispatchToProps);**

But when I use it I always get this
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp