question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compilation error: Property 'htmlType' is missing in type

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.8.0

Environment

Windows 7

Steps to reproduce

After migration to typescript 3.0.1 and antd 3.8.0 I cannot compile project

<Button id="goToTopButton" className="scroll-to-top-button" shape="circle"> <i className="material-icons">arrow_upward</i> </Button>

What is expected?

Compilation sucseed

What is actually happening?

I have compilation error:

TS2322: Type ‘{ children: Element; id: string; className: string; shape: “circle”; }’ is not assignable to type ‘(IntrinsicAttributes & IntrinsicClassAttributes<Button> & Pick<Readonly<{ children?: ReactNode; }> & Readonly<AnchorButtonProps> & Pick<InferProps<{ type: any; shape: any; size: any; htmlType: any; … 4 more …; block: any; }>, “htmlType”>, “color” | … 258 more … | “htmlType”> & Partial<…> & Partial<…>) | …’. Type ‘{ children: Element; id: string; className: string; shape: “circle”; }’ is not assignable to type ‘Pick<Readonly<{ children?: ReactNode; }> & Readonly<NativeButtonProps> & Pick<InferProps<{ type: any; shape: any; size: any; htmlType: any; onClick: any; loading: any; className: any; icon: any; block: any; }>, “htmlType”>, “color” | … 262 more … | “value”>’. Property ‘htmlType’ is missing in type ‘{ children: Element; id: string; className: string; shape: “circle”; }’.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:31 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
sbuschcommented, Aug 13, 2018

I can confirm this is fixed, using:

Package Version
typescript 3.0.1
antd 3.8.1
@types/prop-types 15.5.5

I had to explicitly upgrade @types/prop-types because @types/react requires @types/prop-types without specifying the version ("dependencies": { "@types/prop-types": "*", ).

4reactions
cdeutschcommented, Aug 9, 2018

For a workaround you can downgrade to these NPMs

@types/react@16.4.7 @types/react-dom@16.0.6

See #11697

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript error: Property 'htmlType' is missing in type
After upgrade to typescript 3.0.1 and antd 3.8.0 I have next compilation error: Property 'htmlType' is missing in type '{ children: Element; ...
Read more >
Documentation - Everyday Types - TypeScript
When a value is of type any , you can access any properties of it (which will in turn be ... None of...
Read more >
Solved - Property 'x' is missing in type 'y' but required in type 'z'.
This error occurs when you are not passing all the required props defined in the typing of the component. You can either pass...
Read more >
classname is not assignable to type 'intrinsicattributes' - You.com
Property 'htmlType' is missing in type '{ children: Element; id: string; className: string; shape: "circle"; }'. Open side panel.
Read more >
<input>: The Input (Form Input) element - HTML
If this attribute is not specified, the default type adopted is text . ... The alt attribute displays if the image src is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found