react-redux-typescript icon indicating copy to clipboard operation
react-redux-typescript copied to clipboard

Type '{}' does not satisfy the constraint

Open dandrei opened this issue 7 years ago • 2 comments

I followed the instructions all the way to webpack.

I had to run webpack as ./node_modules/.bin/webpack, so this might be the source of the issue, but I got:

ERROR in [at-loader] ./client/containers/greeting.ts:27:3 TS2344: Type '{}' does not satisfy the constraint 'Pick<Props, "greeting"> & Pick<Props, "updateGreeting">'. Type '{}' is not assignable to type 'Pick<Props, "greeting">'. Property 'greeting' is missing in type '{}'.

ERROR in [at-loader] ./client/containers/increment.ts:26:3 TS2344: Type '{}' does not satisfy the constraint 'Pick<Props, "count"> & Pick<Props, "increment">'. Type '{}' is not assignable to type 'Pick<Props, "count">'. Property 'count' is missing in type '{}'.

dandrei avatar Aug 29 '17 20:08 dandrei

I think the connect type definitions may have changed - it may work if you omit the {} for now - so change <{}> to <>

I will investigate and follow up.

mattnedrich avatar Aug 29 '17 20:08 mattnedrich

Thanks for the fast reply. You're right, <{}> was the issue. <any> works, although I'm not sure that's the best solution.

dandrei avatar Aug 29 '17 20:08 dandrei