WebComponent Support

I am trying to use a WebComponent based package - so i tried:
declare global {
namespace JSX {
interface IntrinsicElements {
item: 'esp-web-tools'
}
}
}
declare global {
namespace JSX {
interface IntrinsicElements {
item: 'esp-web-tools'
}
}
}
However, i still get the error: Property 'esp-web-tools' does not exist on type 'JSX.IntrinsicElements'. How does one do this properly in SolidJS? This exact method worked fine in React - so not sure what to do here.
2 Replies
Otonashi
Otonashi•17mo ago
// anywhere in your project, in a file that is imported by your project, and is not a declaration file
declare module "solid-js" {
namespace JSX {
interface IntrinsicElements {
'esp-web-tools': any; // replace any with the type of props
}
}
}
// anywhere in your project, in a file that is imported by your project, and is not a declaration file
declare module "solid-js" {
namespace JSX {
interface IntrinsicElements {
'esp-web-tools': any; // replace any with the type of props
}
}
}
DaOfficialWizard🧙
this doesn't work tried it .... many times or at least something in my tsconfig /eslint is causing it not to work. Scratch that - i just got it working, you were right. It was a rule in my eslint that was messing with it.