get-convex / get-convex/better-auth

Question: Is the null return type necessary in usePreloadedAuthQuery?

Open
#243 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
764
Forks
126
PR merge metrics
No merged PRs in 30d

Description

Hi!

The [documentation](https://labs.convex.dev/better-auth/migrations/migrate-to-0-10#nextjs-changes) states that the `usePreloadedAuthQuery` function is a drop-in replacement for `usePreloadedQuery`. However, the return signature of `usePreloadedAuthQuery` is following:

https://github.com/get-convex/better-auth/blob/5751ea8ae9952c4803d8ca3f3deea96942dd98d0/src/nextjs/client.tsx#L44

while the `usePreloadedQuery` doesn't have the added `null` return:

https://github.com/get-convex/convex-backend/blob/fcef824ddb49c81f92803d01e8859dd2fad4b7b9/npm-packages/convex/src/react/hydration.tsx#L35

Is this intentional?

Contributor guide

Open the contributing guide

Research direction

Compare the return signature in src/nextjs/client.tsx at line 44 with the referenced usePreloadedQuery definition in Convex's react/hydration.tsx. Check the migration documentation, then determine whether the nullable return is intentional; done means the behavior and type contract are clarified and any necessary documentation or type update is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
nextjs, react, typescript
Domain
authentication, frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.