Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

update type definition of withApollo #3538

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

liweinan0423
Copy link

@liweinan0423 liweinan0423 commented Sep 27, 2019

this resolves #3392

@apollo-cla
Copy link

@liweinan0423: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@shad-k
Copy link

shad-k commented Dec 7, 2019

When can we expect this fix to be released?

@abrahamcuenca
Copy link

@liweinan0423 What is the status of this PR?

WrappedComponent: React.ComponentType<
WithApolloClient<Omit<TProps, 'client'>>
>,
export function withApollo<TProps extends WithApolloClient<{}>, TResult = any>(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this fail if someone has given an explicit TProps argument to withApollo that excludes the WithApolloClient part to make the old version work. For example:

type Props = {user: string}
const ExampleC = ({user, client}: WithApolloClient<Props>) => {...}
const Example = withApollo<Props>(ExampleC)

Here, Props does not extend WithApolloClient<{}> and will cause a type error.

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

Successfully merging this pull request may close these issues.

Type definition of "withApollo" HOC seems wrong
6 participants