Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lakinwecker opened this issue Feb 7, 2020 · 0 comments
Open

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

lakinwecker opened this issue Feb 7, 2020 · 0 comments

Comments

@lakinwecker
Copy link

Description

using as BaseProps is incorrect on this line, isn't it? Shouldn't that be as Diff<BaseProps, InjectedProps>? https://github.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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant