Skip to content

src/hoc/connected-with-count.tsx type cast is incorrect #204

Open
@lakinwecker

Description

@lakinwecker

Description

using as BaseProps is incorrect on this line, isn't it? Shouldn't that be as Diff<BaseProps, InjectedProps>? https://.com/piotrwitek/react-redux-typescript-guide/blob/master/playground/src/hoc/with-connected-count.tsx#L43

As far as I can tell all properties of InjectedProps have been removed on line 37, and restProps now contains only those properties which would be in Diff<BaseProps, InjectedProps>.

Suggested solution(s)

Maybe on line 23 or line 29, add:
type RemainingProps = Diff<BaseProps, InjectedProps>
And then use it as the cast type on line 43, and use it again on line 52.

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