How to hide network request?
I've a react application with react-router.
I'm sending some network requests and I'm trying to hide the request for the client and only expose the returned data, but how should I do that? I've tried to go through this example https://github.com/TanStack/router/tree/main/examples/react/basic-ssr-file-based but the request is still exposed to the client.
GitHub
router/examples/react/basic-ssr-file-based at main · TanStack/router
🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering. - TanStack/router
5 Replies
sensitive-blue•15mo ago
In a client side application you cannot hide a request. Also why would you hide a request?
absent-sapphire•15mo ago
If you were using Start, you could use the
createServerFn
helper to have the "use server"
directive perform that on the server I suppose 🤔.other-emeraldOP•15mo ago
Have start been released?
I just thought it would make sense to hide the communication with the backend for security reasons.
absent-sapphire•15mo ago
What you are talking about is more akin to server-side requests, but SSR is different to that. SSR runs on the server once, and then hydrates on the client (with the full router).
Tanner is hard at work on that one. I dont think we've publicly set a release date for it. Its working though, since Tanstack.com is running on it.
other-emeraldOP•15mo ago
Thanks Sean, you are 100% right!