SolidJSS
SolidJSโ€ข4y agoโ€ข
14 replies
flashblaze

Property 'giscus-widget' does not exist on type 'JSX.IntrinsicElements'

I'm trying to add wrapper for giscus library: https://github.com/giscus/giscus-component for Solid
I'm now probably at the last step but I'm getting this error.
import { createEffect, createSignal } from "solid-js";
import type { GiscusProps } from "./types";

declare global {
  namespace JSX {
    interface IntrinsicElements {
      "giscus-widget": any;
    }
  }
}

export default function Giscus({
  id,
  host,
  repo,
  repoId,
  category,
  categoryId,
  mapping,
  term,
  strict,
  reactionsEnabled,
  emitMetadata,
  inputPosition,
  theme,
  lang,
  loading,
}: GiscusProps) {
  const [mounted, setMounted] = createSignal(false);

  createEffect(() => {
    if (mounted()) return;
    import("giscus");
    setMounted(true);
  });

  return (
    <giscus-widget
      id={id}
      host={host}
      repo={repo}
      repoid={repoId}
      category={category}
      categoryid={categoryId}
      mapping={mapping}
      term={term}
      strict={strict}
      reactionsenabled={reactionsEnabled}
      emitmetadata={emitMetadata}
      inputposition={inputPosition}
      theme={theme}
      lang={lang}
      loading={loading}
    />
  );
}

Any idea what might be causing it?
image.png
GitHub
Component library for giscus, a comments system powered by GitHub Discussions. - GitHub - giscus/giscus-component: Component library for giscus, a comments system powered by GitHub Discussions.
GitHub - giscus/giscus-component: Component library for giscus, a c...
Was this page helpful?