Need Help Getting Started with TanStack
Hello,
I'm new to TanStack and I would like some clarification on an issue I encountered I followed the getting started guide in the TanStack documentation at the following link: https://tanstack.com/router/latest/docs/framework/react/start/getting-started and everything worked perfectly. After testing several features of TanStack, I tried using
Additionally, I was wondering how to determine if a component is rendered server-side (SSR) or client-side (CSR). For example, with Astro, you need to explicitly specify
I'm new to TanStack and I would like some clarification on an issue I encountered I followed the getting started guide in the TanStack documentation at the following link: https://tanstack.com/router/latest/docs/framework/react/start/getting-started and everything worked perfectly. After testing several features of TanStack, I tried using
validateSearch
. However, I noticed that once I use validateSearch
in createFileRoute
, none of the onClick
buttons work anymore. Is this normal behavior?Additionally, I was wondering how to determine if a component is rendered server-side (SSR) or client-side (CSR). For example, with Astro, you need to explicitly specify
client:load
on a component to ensure it runs as CSR and its JavaScript functionalities work properly.
Thanks in advance for your help! ๐8 Replies
other-emeraldโข10mo ago
Hello, for your first issue (onClick not working) it seems like something crashed during hydration and it didn't complete. Can you check for console errors in the Browser DevTools? That can give us some idea on what could be breaking ๐
Regarding your second question, everything should be server rendered on the first load, and then client rendered for subsequents navigations.
Remember when doing server rendering, everything inside useEffect won't execute on the server and it will run on the client after hydration
blank-aquamarineOPโข10mo ago
Here is my console when I activate
validateSearch
:
blank-aquamarineOPโข10mo ago
And here it is when I remove
validateSearch
:
blank-aquamarineOPโข10mo ago
๐
absent-sapphireโข10mo ago
please provide a minimal complete example
blank-aquamarineOPโข10mo ago
Here is the file I am having an issue with: https://github.com/GardoTL/test-tanstack/blob/main/app/routes/index.tsx ๐
GitHub
test-tanstack/app/routes/index.tsx at main ยท GardoTL/test-tanstack
Contribute to GardoTL/test-tanstack development by creating an account on GitHub.
absent-sapphireโข10mo ago
can you please strip it down to the bare minimum?
blank-aquamarineOPโข10mo ago
Yes