-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
TSX: Property does not exist on type 'JSX.IntrinsicElements' #15449
Comments
TypeScript Version: 2.3.1 Same error here, my React components are suddenly all "wrong": interface Props {
...
scopes: any;
}
interface State {}
export class App extends React.Component<Props, State> {
render() {
return <Content {...this.props} />; // error
}
} interface Props {
...
// without scopes in Props
}
export default class Content extends React.Component<Props, {}>{
...
} error:
|
@luca-moser what version of TypeScript was it last working on? |
Okay, I found out how to fix this. Instead of putting the // test.tsx
import * as React from 'react';
let Something = React.createClass({
render: function() {
return (<div><heyo>foo</heyo></div>);
}
}) // test.d.ts
declare namespace JSX {
interface IntrinsicElements {
heyo: any
}
} The command: |
You can also put that second block inside |
@luca-moser your issue isn't really the same. Yours is a bug in TS and will be fixed with #13288. In the meantime you should stay on 2.2. |
I get
Not sure where to report this. Solution
|
For anyone else who might find this issue as a solution to custom tags in the future. In addition to @iffy and @RyanCavanaugh global namespace solution, you can declare your custom element type like this:
In order to get better type/property checking and code completion on your custom tags |
@TheAfterman Can you help me modify your solution to work with components such as
but the typings don't support additional tags for this component so I get this error |
TypeScript Version: 2.3.1
Code
Expected behavior:
I expect it to compile without error.
Actual behavior:
Running this command:
I get this output:
I got the
declare
statement from #4648The text was updated successfully, but these errors were encountered: