Need help hiding JSX data from unauthorized users
Unanswered
Giant panda posted this in #help-forum
Original message was deleted.
15 Replies
check the user's authentication status first in server side befoer sending jsx?
is the jsx a string or a jsx
@aardani is the jsx a string or a jsx
Giant panda
jsx
@aardani check the user's authentication status first in server side befoer sending jsx?
Giant panda
sending the JSX over HTTP?
I tried sending it as json
but I don't know how to parse objects to react nodes
I mean why not just use page.tsx for it?
@aardani I mean why not just use page.tsx for it?
Giant panda
cause then that code is shipped to the client and anyone can see it regardless of their subscription status
but it's fine I figured out how to ship it from the server
you just use React.cloneElement to parse json from compiled JSX to a react element
Giant panda
Actually nevermind
Imma quickly check if page.tsx code actually gets shipped to the client or not
Giant panda
yeah it does
so that's not a solution
the problem is that while I can serialize HTML JSX like <h1> etc i can't do components