developit / unistore

🌶 350b / 650b state container with component actions for Preact & React
https://npm.im/unistore
2.86k stars 139 forks source link

connect in React.FunctionComponent? #173

Closed eduardoborges closed 5 years ago

eduardoborges commented 5 years ago

I am using typescript and I am trying to connect in the store.

I received the type error:

Argument of type 'FunctionComponent<Props>' is not assignable to parameter of type '((props: unknown) => ReactNode) | ComponentClass<unknown, unknown>'. Type 'FunctionComponent<Props>' is not assignable to type '(props: unknown) => ReactNode'. Types of parameters 'props' and 'props' are incompatible. Type 'unknown' is not assignable to type 'PropsWithChildren<Props>'. Type 'unknown' is not assignable to type 'Props'.ts(2345)

Any solution?

developit commented 5 years ago

I believe this is now fixed on master. Please let me know!

arryanggaputra commented 4 years ago
Argument of type '(props: LoginProps) => JSX.Element' is not assignable to parameter of type '((props: unknown) => ReactNode) | ComponentClass<unknown, unknown> | FC<unknown>'.
  Type '(props: LoginProps) => JSX.Element' is not assignable to type '(props: unknown) => ReactNode'.
    Types of parameters 'props' and 'props' are incompatible.
      Type 'unknown' is not assignable to type 'LoginProps'.

@developit do you have any suggestion?

developit commented 4 years ago

@arryanggaputra are you using React, or Preact?

arryanggaputra commented 4 years ago

@developit React Native 🙂