Need help hiding JSX data from unauthorized users
Unanswered
Asian black bear 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
@alfon is the jsx a string or a jsx
Asian black bear
jsx
@alfon check the user's authentication status first in server side befoer sending jsx?
Asian black bear
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?
@alfon I mean why not just use page.tsx for it?
Asian black bear
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
Asian black bear
Actually nevermind
Imma quickly check if page.tsx code actually gets shipped to the client or not
Asian black bear
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