-
As far as I can see solid.js allows me to use web components directly in the jsx template. In runtime in works fine, but typescript says there is an error According to logs from ts language server it use
If I add my custom component in solidjs definitions - ts finally happy The thing I can't figure out is why I can't extend the solid.js JSX namespace, and how should custom components in project with solid js |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
We don't pollute the global TypeScript namespace with our JSX definition. While there isn't a custom elements example it should be roughly the same: https://www.solidjs.com/guides/typescript#special-jsx-attributes-and-directives. Notice module "solid-js" and you may need to import JSX from "solid-js" as well. |
Beta Was this translation helpful? Give feedback.
-
@ryansolid thank you! Next code in declare global {
declare module "solid-js" {
namespace JSX {
interface IntrinsicElements {
'map-gl': MapGlProps;
}
}
}
} |
Beta Was this translation helpful? Give feedback.
@ryansolid thank you! Next code in
index.d.ts
cover my case! Import of JSX from solid-js not required