flashblaze
flashblaze
SSolidJS
Created by flashblaze on 11/23/2024 in #support
How to use useSubmission in layout?
Damn. That did it. Thanks!
5 replies
SSolidJS
Created by flashblaze on 12/11/2022 in #support
Property 'giscus-widget' does not exist on type 'JSX.IntrinsicElements'
Will check this tonight and let you know if I find anything
15 replies
SSolidJS
Created by flashblaze on 12/11/2022 in #support
Property 'giscus-widget' does not exist on type 'JSX.IntrinsicElements'
thanks for the help!
import { createEffect, createSignal } from "solid-js";
import type { GiscusProps } from "./types";

declare module "solid-js" {
namespace JSX {
interface IntrinsicElements {
"giscus-widget": GiscusWidgetAttributes;
}
}
}

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}
/>
);
}
import { createEffect, createSignal } from "solid-js";
import type { GiscusProps } from "./types";

declare module "solid-js" {
namespace JSX {
interface IntrinsicElements {
"giscus-widget": GiscusWidgetAttributes;
}
}
}

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}
/>
);
}
this is now working w/o any errors
15 replies
SSolidJS
Created by flashblaze on 12/11/2022 in #support
Property 'giscus-widget' does not exist on type 'JSX.IntrinsicElements'
will do. i was following the pattern given in the repo but it did not work and so i tried the above code. following the repo i added the below code in vite-env.d.ts but still the same error
/// <reference types="vite/client" />

interface GiscusWidgetAttributes {
id?: string;
host?: string;
repo: `${string}/${string}`;
repoid: string;
category?: string;
categoryid?: string;
mapping: import("./lib/types").Mapping;
term?: string;
theme?: import("./lib/types").Theme;
strict?: import("./lib/types").BooleanString;
reactionsenabled?: import("./lib/types").BooleanString;
emitmetadata?: import("./lib/types").BooleanString;
inputposition?: import("./lib/types").InputPosition;
lang?: import("./lib/types").AvailableLanguage;
loading?: import("./lib/types").Loading;
}

declare namespace JSX {
interface IntrinsicElements {
"giscus-widget": GiscusWidgetAttributes;
}
}
/// <reference types="vite/client" />

interface GiscusWidgetAttributes {
id?: string;
host?: string;
repo: `${string}/${string}`;
repoid: string;
category?: string;
categoryid?: string;
mapping: import("./lib/types").Mapping;
term?: string;
theme?: import("./lib/types").Theme;
strict?: import("./lib/types").BooleanString;
reactionsenabled?: import("./lib/types").BooleanString;
emitmetadata?: import("./lib/types").BooleanString;
inputposition?: import("./lib/types").InputPosition;
lang?: import("./lib/types").AvailableLanguage;
loading?: import("./lib/types").Loading;
}

declare namespace JSX {
interface IntrinsicElements {
"giscus-widget": GiscusWidgetAttributes;
}
}
15 replies