Corbi-Wan Kenobi
Corbi-Wan Kenobi
CCConvex Community
Created by Corbi-Wan Kenobi on 2/27/2025 in #support-community
TanStack Start and Convex Pagination glitches
Downgrading convex did not solve the problem in the project I originally posted about. Something must have changed in TanStack Start then?
9 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/27/2025 in #support-community
TanStack Start and Convex Pagination glitches
And I'm using this page's directions. https://docs.convex.dev/database/pagination
9 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/27/2025 in #support-community
TanStack Start and Convex Pagination glitches
So, I'm not crazy. I have another project I'm working on that I haven't touched in a few weeks that I basically copied and pasted the code for pagination and queries, but it is still running "@tanstack/start": "^1.97.2", and it works as I remember. The component in the outlet does not reload, it is added onto, and I can get all the way to the end and it doesn't crash. So it looks like something in TSStart changed enough to break this. Like I said, the code structure is identical, I'm just calling different databases/tables. The only difference is the version of Start and "convex": "^1.17.0". I could roll back the version of Convex in the project that is breaking to see if that makes a difference.
9 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/24/2025 in #support-community
useQuery giving undefined while useSuspenseQuery gives results
If I need to make multiple queries to populate different parts of my page, what's the strategy there since useSuspendedQuery returns a data and I need to refer to them uniquely? Or do I need to return everything I might need in one query? I don't need reactivity in this case if that helps. DISREGARD - sorry, still finding the line between platform specific stuff and react/JSX. I think I got it.
5 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/24/2025 in #support-community
useQuery giving undefined while useSuspenseQuery gives results
Oh ok. Do I need to follow that model at all times while using Start? I'm still new to the whole TanX world so I'm not sure what's assumed tied in or not (Query for example being a part of the Convex piece).
5 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/14/2025 in #support-community
How to query while inside a function?
Can't use useQuery here, invalid hook. export function LoginForm() { const [email, setEmail] = useState(""); const [message, setMessage] = useState(""); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); const result = useQuery(api.personEmails.checkCanLogin, { emailAddress: email }); if (!result?.canLogin) { setMessage(result?.message ?? "An error occurred"); } else { setMessage("Login successful!"); } }; return ( form here
6 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/14/2025 in #support-community
How to query while inside a function?
Just a query.
6 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/11/2025 in #support-community
Preferred method for saving formatted text in string fields?
I figured as much, just making sure I wasn't missing a convex detail.
7 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/11/2025 in #support-community
Preferred method for saving formatted text in string fields?
How do line breaks translate when it's used in a compnent via something like {data.descriptionField}? Right now it displays as all one paragraph, no line breaks even though they do appear in the Dashboard.
7 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/11/2025 in #support-community
When to query data in a framework's loader vs a route component? Or imported component?
OK, that's way too easy.
25 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/11/2025 in #support-community
When to query data in a framework's loader vs a route component? Or imported component?
Perfect. Thanks for the direction.
25 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/11/2025 in #support-community
When to query data in a framework's loader vs a route component? Or imported component?
OK, so how do I call/refer to params in the component? I'm going to try to figure it out first based on the example, but the example doesn't specifically use params
25 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/11/2025 in #support-community
When to query data in a framework's loader vs a route component? Or imported component?
Yeah, thats the fly in the ointment.
25 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/11/2025 in #support-community
When to query data in a framework's loader vs a route component? Or imported component?
OK, so, if I can't call useQuery in the loader, and the Route const is where the params are called, how do I use useQuery to subscribe to a dynamic route with params? Do I do something like make a const evenId = params.eventId in the loader and pass that via useLoaderData to the component to then have it to use in UseQuery? or can I call params in the component also and not just up tine Route const?
25 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/11/2025 in #support-community
When to query data in a framework's loader vs a route component? Or imported component?
Oh man. I can't read today! Scribbing/Subscribe = mild dyslexia!
25 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/11/2025 in #support-community
When to query data in a framework's loader vs a route component? Or imported component?
Oops, word context. I was scrubbing through the video meaning quickly scanning.
25 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/11/2025 in #support-community
When to query data in a framework's loader vs a route component? Or imported component?
I'm scrubbing through your Building with TanStack Start and Convex Demo youtube looking for inspiration. 🙂
25 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 2/11/2025 in #support-community
When to query data in a framework's loader vs a route component? Or imported component?
What does it look like to subscribe to a dynamic route in the loader? Can't use useQuery because its a invalid hook call. I have it working non-reactive. export const Route = createFileRoute("/events/$eventId")({ component: Event, loader: async ({ context, params }) => { return await context.queryClient.fetchQuery( convexQuery(api.events.getEvent, { eventId: params.eventId as Id<"events">, }), ); }, });
25 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 1/26/2025 in #support-community
Using pagination in convex vs something like TanStack Tables?
As I think it through, I could get away with an infinite scroll table, technically. In my app this list of devices is in a table. Come to think of it, (not a convex questions strictly) can you make a <table> that is infinite school? Pardon the ignorance, I've just never messed with infinite scroll results before. Offset pagination is a relatively simple prospect in other databases that take things like limit and offset nativly. Not a dis on convex, just a learning curve thing.
22 replies
CCConvex Community
Created by Corbi-Wan Kenobi on 1/26/2025 in #support-community
Using pagination in convex vs something like TanStack Tables?
@lee Hey there. I'm back to this. I'm getting a "tree is empty" error. Would you be able to whip up a version of your photos offset-based pagination example, but instead of sorting by _creationTime it was based on the album name? That's basically what I'm doing, whole table sorted by one field that is (in my case) always unique (or maybe first sorted by album name then by _creationTime as a tie breaker). This is what I'm using to call for the data. const { data } = useSuspenseQuery( convexQuery(api.devices.paginatedDevices, { offset: 0, numItems: 10 }), ); Also, once I get results, can I use either the native pagination functions, and/or the getPage helper functions? Or neither and add in some kind of offset+ to generate sets and links to sets of pages of results?
22 replies