jeromemarshall
jeromemarshall
TTCTheo's Typesafe Cult
Created by jeromemarshall on 5/8/2023 in #questions
Acessing a route api in app dir causes re-render loop.
now Im getting a Unhandled Runtime Error - Unexpected token H in JSON at position 0 this is my route.ts
export async function POST(req: Request) {
return new Response(
JSON.stringify({
message: "Hello world",
})
)
}
export async function POST(req: Request) {
return new Response(
JSON.stringify({
message: "Hello world",
})
)
}
4 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/23/2023 in #questions
How to skip batching for a single trpc query in trpc v10?
@jingleberry thanks a ton man
3 replies
TTCTheo's Typesafe Cult
Created by H on 3/23/2023 in #questions
SignIn discord user if he is on a certain Server
ikr, sometimes you cant help it but hack your way through
8 replies
TTCTheo's Typesafe Cult
Created by H on 3/23/2023 in #questions
SignIn discord user if he is on a certain Server
you can use the signin callback in the nextauth options to achieve this
8 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/21/2023 in #questions
Next-auth useSession throws an exception in prod. Please help
Thanks man
7 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/21/2023 in #questions
Next-auth useSession throws an exception in prod. Please help
@Stu Peyca Nah mate, I had found out what was causing the problem. I had used the react-tooltip library and that was causing the problem. Seems weird, but removing it solved the issue.
7 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/21/2023 in #questions
Next-auth useSession throws an exception in prod. Please help
7 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/8/2023 in #questions
How to use react toastify to show a promise toast when using a mutation in trpc?
cool man... lemme check it out
26 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/8/2023 in #questions
How to use react toastify to show a promise toast when using a mutation in trpc?
woah
26 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/8/2023 in #questions
How to use react toastify to show a promise toast when using a mutation in trpc?
toast.loading
If you want to take care of each step yourself you can use toast.loading and update the notification yourself.

const id = toast.loading("Please wait...")
//do something else
toast.update(id, { render: "All is good", type: "success", isLoading: false });
toast.loading
If you want to take care of each step yourself you can use toast.loading and update the notification yourself.

const id = toast.loading("Please wait...")
//do something else
toast.update(id, { render: "All is good", type: "success", isLoading: false });
26 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/8/2023 in #questions
How to use react toastify to show a promise toast when using a mutation in trpc?
i guess I can do this like this,
26 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/8/2023 in #questions
How to use react toastify to show a promise toast when using a mutation in trpc?
to be more elaborate, I'm fetching data from another API using this mutation. So I would need the loading toast till the data is sent to the client.
26 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/8/2023 in #questions
How to use react toastify to show a promise toast when using a mutation in trpc?
26 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/8/2023 in #questions
How to use react toastify to show a promise toast when using a mutation in trpc?
react-toastify
26 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/8/2023 in #questions
How to use react toastify to show a promise toast when using a mutation in trpc?
but im still confused how you do this inside that function.
const resolveAfter3Sec = new Promise(resolve => setTimeout(resolve, 3000));
toast.promise(
resolveAfter3Sec,
{
pending: 'Promise is pending',
success: 'Promise resolved 👌',
error: 'Promise rejected 🤯'
}
)
const resolveAfter3Sec = new Promise(resolve => setTimeout(resolve, 3000));
toast.promise(
resolveAfter3Sec,
{
pending: 'Promise is pending',
success: 'Promise resolved 👌',
error: 'Promise rejected 🤯'
}
)
26 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/8/2023 in #questions
How to use react toastify to show a promise toast when using a mutation in trpc?
thanks man
26 replies
TTCTheo's Typesafe Cult
Created by jeromemarshall on 3/8/2023 in #questions
How to use react toastify to show a promise toast when using a mutation in trpc?
@Neto there is no onSuccess, but there is isSuccess. But if I have understood it correctly, I need a Promise to be returned to trigger a promise toast. but isSuccess is boolean
26 replies