Skip to content

Why is Router.useSearch() Returning an Incorrect Google ID After Passport.js Authentication in TanStack Router? #3185

Answered by schiller-manuel
imSamiul asked this question in Q&A
Discussion options

You must be logged in to vote

As you pointed out, you cannot treat this large value as a number in JS. Here is a solution that parses the value as bignumber:

https://stackblitz.com/edit/tanstack-router-2wgeegss?file=src%2Froutes%2Fabout.tsx,src%2Fmain.tsx&preset=node

import JSONBigNumber from 'json-bignumber';

const router = createRouter({
  routeTree,
  defaultPreload: 'intent',
  parseSearch: parseSearchWith(JSONBigNumber),
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by imSamiul
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants