{
+ const res = await fetch(
+ `/api/comments?post_id=${postId}&limit=${limit}&offset=${offset}`
+ );
+ const data = await res.json();
+ return data;
+}
+
// Send the registration request to the server
export async function submitRegistration(
username: string,
From da4f5cbb139deafa3764cc0ae9f0f8c788590d97 Mon Sep 17 00:00:00 2001
From: Imbus <>
Date: Tue, 27 Feb 2024 04:02:42 +0100
Subject: [PATCH 8/8] Using splitProps to preserve reactivity in LoginModal
---
client-solid/src/Containers/LoginModal.tsx | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/client-solid/src/Containers/LoginModal.tsx b/client-solid/src/Containers/LoginModal.tsx
index 1bbd97d..3c08306 100644
--- a/client-solid/src/Containers/LoginModal.tsx
+++ b/client-solid/src/Containers/LoginModal.tsx
@@ -1,4 +1,4 @@
-import { JSXElement, Show, onCleanup, useContext } from "solid-js";
+import { JSXElement, Show, onCleanup, splitProps, useContext } from "solid-js";
import { LoginForm } from "../Components/Login";
import { RegisterForm } from "../Components/Register";
@@ -61,10 +61,11 @@ export function LoginModal(): JSXElement {
}
// Local wrapper component for the login and register forms
-function FormContainer({ children }: { children: JSXElement }): JSXElement {
+function FormContainer(props: { children: JSXElement }): JSXElement {
+ const [local] = splitProps(props, ["children"]);
return (
- {children}
+ {local.children}
);
}
{comment.content}
+