-
-
Notifications
You must be signed in to change notification settings - Fork 48k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation error: Property 'htmlType' is missing in type #11677
Comments
我也遇到这个问题了,不过是其他组件,typescript描述文件有很多问题 |
<List.Item column xxl xl lg md sm xs key={index} className={className} style={{ ...style, padding: "12px" }}> List.Item里面居然有这么多个不相关的属性column xxl xl lg md sm xs |
This is related to following new changes introduced in TypeScript 3.0. -
A workaround is to downgrade TypeScript to 2.x. |
this worked for me Property 'htmlType' is missing in type '{ shape: "circle"; icon: string; }' add |
PR is welcome~ |
migration to typescript 2.x also does not help have next error: |
I get a similar error:
Workaround:
export interface RcFile extends File {
uid: string;
lastModifiedDate?: Date;
} to export interface RcFile extends File {
uid: string;
lastModifiedDate: Date;
} Related issue: #11625 |
I've encountered the same problem. And there's no way to override the class declarations to temporarily solve it because Ant exports all classes as default, which basically makes it impossible to augment. Might I suggest stopping with default exporting in the project? It sucks for typescript augmentation, which would solve this problem for a brief |
Same problem |
For a workaround you can downgrade to these NPMs
See #11697 |
@BoostIO funded this issue with $20. Visit this issue on Issuehunt |
I think that s a bug in antd3.8.0 |
Just upgrade to antd 3.8.1 and found the types issues for Input, List.Item and etc have been disappeared. Meanwhile checked with the generated d.ts. Let's take static propTypes: {
type: PropTypes.Requireable<string>;
shape: PropTypes.Requireable<string>;
size: PropTypes.Requireable<string>;
htmlType: PropTypes.Requireable<string>;
onClick: PropTypes.Requireable<(...args: any[]) => any>;
loading: PropTypes.Requireable<boolean | object>;
className: PropTypes.Requireable<string>;
icon: PropTypes.Requireable<string>;
block: PropTypes.Requireable<boolean>;
}; it seems that the combination of latest |
This issue should have been fixed in 3.8.1 with latest version of @types/react. |
I can confirm this is fixed, using:
I had to explicitly upgrade |
@afc163 has started working. Visit this issue on Issuehunt |
@BoostIO cancelled funding, $20, of this issue. Visit this issue on Issuehunt |
@afc163 has started working. Visit this issue on Issuehunt |
1 similar comment
@afc163 has started working. Visit this issue on Issuehunt |
@afc163 has submitted output. Visit this issue on Issuehunt |
The issue re-appears in antd 3.10.0 and typescript 3.1.1 |
Still running into this issue :(
|
Seem's that in @yesmeck I believe this should be re-opened because the current code is incorrectly implementing the static interface. // lib/button/button.d.ts
export default class Button extends React.Component<ButtonProps, any> {
// ...
static propTypes: {
type: any;
shape: any;
size: any;
htmlType: any;
onClick: any;
loading: any;
className: any;
icon: any;
};
// ...
} // react/index.d.ts:357
interface ComponentClass<P = {}, S = ComponentState> extends StaticLifecycle<P, S> {
new (props: P, context?: any): Component<P, S>;
propTypes?: ValidationMap<P>; // here propTypes is optional
contextTypes?: ValidationMap<any>;
childContextTypes?: ValidationMap<any>;
defaultProps?: Partial<P>;
displayName?: string;
} |
Running into the same issue |
@jbuschke Could you reproduce this problem with a simple demo? |
I often run into this issue when I upgrade my package dependencies through The only work around I find is to delete the yarn.lock file and re-run |
@onlyann or use https://github.com/atlassian/yarn-deduplicate maybe? |
I'd recommend ditching They've never been able to fix that duplicate problem and it's not worth fighting when Took me a long time to ditch it but very happy with |
Just to clarify; it's subjectively a It can be a desirable behaviour if one wants to keep stable dependencies. On the other hand, having only one version of a Lib may be desirable but has the tradeoff of maybe forcing a lib dependency to an incompatible version. Everything is a trade-off :) |
I have the I'm running: The setup makes it hard to replicate, but can provide more info if needed. Thanks. |
I was experiencing this issue, but after upgrading to v3.16.5 I am no longer seeing it. |
Version
3.8.0
Environment
Windows 7
Steps to reproduce
After migration to
typescript 3.0.1
andantd 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:
The text was updated successfully, but these errors were encountered: