benawad / fullstack-graphql-airbnb-clone

A Fullstack GraphQL Airbnb Clone with React and React Native
MIT License
1.68k stars 445 forks source link

Argument of type 'typeof C' is not assignable #18

Closed hemedani closed 5 years ago

hemedani commented 5 years ago

I have this error in controller/src/modules/RegisterController/index.tsx

on this line : export const RegisterController = graphql(registerMutation)(C);

I think this error throw because of ChildMutateProps but I can't resovle the issue

[ts]
Argument of type 'typeof C' is not assignable to parameter of type 'ComponentType<Partial<DataProps<any, any>> & Partial<MutateProps<any, any>> & Props>'.
  Type 'typeof C' is not assignable to type 'ComponentClass<Partial<DataProps<any, any>> & Partial<MutateProps<any, any>> & Props, any>'.
    Types of parameters 'props' and 'props' are incompatible.
Type 'Partial<DataProps<any, any>> & Partial<MutateProps<any, any>> & Props' is not assignable to type 'Readonly<ChildMutateProps<Props, any, any>>'.
        Types of property 'mutate' are incompatible.
          Type 'MutationFn<any, any> | undefined' is not assignable to type 'MutationFn<any, any>'.
            Type 'undefined' is not assignable to type 'MutationFn<any, any>'. [2345]
hemedani commented 5 years ago

I just cast it to any

export const RegisterController = graphql(registerMutation)(C as any);

benawad commented 5 years ago

Sorry for the late response.

That's a fine way to handle it.