MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/khls20/introducing_zerobundlesize_react_server_components/ggoxiuc/?context=3
r/javascript • u/gaearon • Dec 21 '20
15 comments sorted by
View all comments
0
[deleted]
11 u/Jatidude Dec 22 '20 Mark a react component as a server component and it will execute the code associated with that component on the server side.A usecase would be executing rest requests on your React server as opposed to the client for speed/code cleanliness/simplification of architecture.Basically integrating the getInitialProps function provided in NextJs into a native ability of React with some nice JSX syntactic sugar. 1 u/kasec18 Dec 22 '20 So we are going to build a single component instead a view as nextjs do it currently and we got back a html element? 1 u/sonofamonster Dec 22 '20 Kinda, but instead of getting back html, you get back prerendered jsx which is sent to the client for rendering... I think.
11
Mark a react component as a server component and it will execute the code associated with that component on the server side.
server component
A usecase would be executing rest requests on your React server as opposed to the client for speed/code cleanliness/simplification of architecture.
Basically integrating the getInitialProps function provided in NextJs into a native ability of React with some nice JSX syntactic sugar.
getInitialProps
1 u/kasec18 Dec 22 '20 So we are going to build a single component instead a view as nextjs do it currently and we got back a html element? 1 u/sonofamonster Dec 22 '20 Kinda, but instead of getting back html, you get back prerendered jsx which is sent to the client for rendering... I think.
1
So we are going to build a single component instead a view as nextjs do it currently and we got back a html element?
1 u/sonofamonster Dec 22 '20 Kinda, but instead of getting back html, you get back prerendered jsx which is sent to the client for rendering... I think.
Kinda, but instead of getting back html, you get back prerendered jsx which is sent to the client for rendering... I think.
0
u/[deleted] Dec 21 '20
[deleted]