diff --git a/client-solid/src/Components/Comment.tsx b/client-solid/src/Components/Comment.tsx index 94fda21..325d164 100644 --- a/client-solid/src/Components/Comment.tsx +++ b/client-solid/src/Components/Comment.tsx @@ -1,4 +1,4 @@ -import { JSXElement, splitProps } from "solid-js"; +import { JSXElement } from "solid-js"; import { PublicComment } from "../Util/api"; @@ -7,13 +7,12 @@ interface CommentProps { } export function Comment(props: CommentProps): JSXElement { - const [local] = splitProps(props, ["comment"]); return ( <>
- +
-
{local.comment.content}
+
{props.comment.content}
); diff --git a/client-solid/src/Components/CommentSection.tsx b/client-solid/src/Components/CommentSection.tsx index cb3b830..994553a 100644 --- a/client-solid/src/Components/CommentSection.tsx +++ b/client-solid/src/Components/CommentSection.tsx @@ -1,18 +1,16 @@ -import { For, JSXElement, createResource, splitProps } from "solid-js"; +import { For, JSXElement, createResource } from "solid-js"; import { getComments } from "../Util/api"; import { Comment } from "./Comment"; -export function CommentSection(postId: { postId: string }): JSXElement { - const [local] = splitProps(postId, ["postId"]); - // Not sure why this is a resource, refetch is not implemented - const [state] = createResource(() => getComments(local.postId, 10, 0)); +export function CommentSection(props: { postId: string }): JSXElement { + const [comments] = createResource(props.postId, () => + getComments(props.postId, 10, 0) + ); return ( -
- Loading...
}> - {(comment) => } - -
+
+ {(comment) => } +
); }