Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Latest ReactRedux template from generator doesn't work #878

Closed
empz opened this issue Apr 19, 2017 · 4 comments
Closed

Latest ReactRedux template from generator doesn't work #878

empz opened this issue Apr 19, 2017 · 4 comments

Comments

@empz
Copy link

empz commented Apr 19, 2017

Installed latest generator-aspnetcore-spa
Created a ReactRedux app
dotnet run

App shows the following error:

ERROR in [at-loader] ./ClientApp/components/Layout.tsx:13:21 
    TS2322: Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<NavMenu> & { children?: ReactNode; } & void'.
  Type '{}' is not assignable to type 'void'.
@Sohojoe
Copy link

Sohojoe commented Apr 20, 2017

it worked for me about 20mins ago

npm install -g yo generator-aspnetcore-spa

@SteveSandersonMS
Copy link
Member

@Sohojoe - thanks for confirming.

I just checked and it worked fine for me too. @emzero, I guess you were seeing an issue in 3rd-party code that's since been fixed.

Closing as resolved.

@SteveSandersonMS
Copy link
Member

Finally I was able to repro this issue, and have applied a fix in dev. It's still not clear to me why it wasn't reproing before, and why the error still doesn't show up in VS Code (presumably it's a change in the TypeScript compiler, but I don't know exactly what).

@DanHarman
Copy link
Contributor

I think this was due to an enhancement with typescript 2.3.1 and due to incorrect use of void generic args to react components, when it should have been {} (empty objects) as react always has an empty state/props object when none is defined, so defining as void is incorrect.

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

No branches or pull requests

4 participants