"use client";
import { useState } from "react";
import { api } from "~/trpc/server";
export default function Text() {
const [isSignUp, setIsSignUp] = useState(false);
const handleSignUp = async () => {
try {
const { name, email, password } = { name: "John Doe", email: "[email protected]", password: "password123" };
const signupReq = await api.user.signup.mutate({ name, email, password });
console.log(signupReq);
} catch (error) {
console.error("Error occurred during sign up:", error);
}
};
return (
<main className="">
<button onClick={handleSignUp}>Sign Up</button>
</main>
);
}
"use client";
import { useState } from "react";
import { api } from "~/trpc/server";
export default function Text() {
const [isSignUp, setIsSignUp] = useState(false);
const handleSignUp = async () => {
try {
const { name, email, password } = { name: "John Doe", email: "[email protected]", password: "password123" };
const signupReq = await api.user.signup.mutate({ name, email, password });
console.log(signupReq);
} catch (error) {
console.error("Error occurred during sign up:", error);
}
};
return (
<main className="">
<button onClick={handleSignUp}>Sign Up</button>
</main>
);
}