-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isLoading is not working it is giving error can anyone help #82
Comments
@JayGadhethariya456 And what is the error? |
Property 'isLoading' does not exist on type 'UseTRPCMutationResult<{ url: string | null; }, TRPCClientErrorLike<{ input: void; output: { url: string | null; }; transformer: false; errorShape: DefaultErrorShape; }>, void, unknown>'. i even used chatgpt and copilot both didn't solved the error |
@JayGadhethariya456 Did you changed something somewhere in your code or did you just run Tested it quickly via
and can't reproduce your issue ( |
this is happening when i hover on isLoading Property 'isLoading' does not exist on type 'UseTRPCMutationResult<{ url: string | null; }, TRPCClientErrorLike<{ input: void; output: { url: string | null; }; transformer: false; errorShape: DefaultErrorShape; }>, void, unknown>'.ts(2339) |
i have used exact code of josh's code |
maybe it helps to restart the typescript server in your VSC ( or whatever you use :) ). |
ive done that too. something is wrong with isLoading. |
any chance to provide a repro ( e.g. via stackblitz / codesandbox )? |
@JayGadhethariya456 @noxify I get the same error. Are there any news on this? |
This code worked for me i hope it works for u too. import { useState } from 'react'; // Import useState hook interface BillingFormProps {
const BillingForm = ({ const { mutate: createStripeSessionMutation } = const handleMutate = async () => { return (
); export default BillingForm; |
OR Replace |
'use client'
import { getUserSubscriptionPlan } from '@/lib/stripe'
import { useToast } from './ui/use-toast'
import { trpc } from '@/app/_trpc/client'
import MaxWidthWrapper from './MaxWidthWrapper'
import {
Card,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from './ui/card'
import { Button } from './ui/button'
import { Loader2 } from 'lucide-react'
import { format } from 'date-fns'
interface BillingFormProps {
subscriptionPlan: Awaited<
ReturnType
}
const BillingForm = ({
subscriptionPlan,
}: BillingFormProps) => {
const { toast } = useToast()
const { mutate: createStripeSession, isLoading } =
trpc.createStripeSession.useMutation({
onSuccess: ({ url }) => {
if (url) window.location.href = url
if (!url) {
toast({
title: 'There was a problem...',
description: 'Please try again in a moment',
variant: 'destructive',
})
}
},
})
return (
<form
className='mt-12'
onSubmit={(e) => {
e.preventDefault()
createStripeSession()
}}>
Subscription Plan
You are currently on the{' '}
{subscriptionPlan.name} plan.
)
}
export default BillingForm
The text was updated successfully, but these errors were encountered: