-
Notifications
You must be signed in to change notification settings - Fork 3
/
db4a5878.c7df2dff.js
1 lines (1 loc) · 4.33 KB
/
db4a5878.c7df2dff.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{117:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return i})),n.d(t,"rightToc",(function(){return p})),n.d(t,"default",(function(){return u}));var r=n(3),o=n(7),a=(n(0),n(134)),c={slug:"react-server-component",title:"What is React Server Component",author:"Bunlong",author_title:"React Patterns Team",author_url:"https://github.com/Bunlong",author_image_url:"https://avatars1.githubusercontent.com/u/37023003?s=400&u=0049c6773040efb265cdf622076305f8b47facec&v=4",tags:["server"],image:"/img/react-server-component.png"},i={permalink:"/blog/react-server-component",source:"@site/blog/2021-01-03-react-server-component.md",description:"What is React Server Component?",date:"2021-01-03T00:00:00.000Z",tags:[{label:"server",permalink:"/blog/tags/server"}],title:"What is React Server Component",readingTime:1.005,truncated:!0,prevItem:{title:"React Hooks Cheat Sheet",permalink:"/blog/react-hooks-cheat-sheet"},nextItem:{title:"How to use async function in useEffect hook?",permalink:"/blog/how-to-use-async-function-in-useEffect-hook"}},p=[{value:"What is React Server Component?",id:"what-is-react-server-component",children:[]}],s={rightToc:p};function u(e){var t=e.components,c=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},s,c,{components:t,mdxType:"MDXLayout"}),Object(a.b)("p",null,Object(a.b)("img",{alt:"What is React Server Component?",src:n(157).default,title:"What is React Server Component?"})),Object(a.b)("h2",{id:"what-is-react-server-component"},"What is React Server Component?"),Object(a.b)("p",null,"React Server Component (CSR) is a new component in React."),Object(a.b)("p",null,"Recently, All components in React are client-side component (MyComponent.js) but now you can create them as server-side component by just adding ",Object(a.b)("inlineCode",{parentName:"p"},".server")," (MyComponent.server.js)."),Object(a.b)("p",null,"Anyway client-size component and server-size component work together very well."))}u.isMDXComponent=!0},134:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),u=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},l=function(e){var t=u(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},f=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,s=p(e,["components","mdxType","originalType","parentName"]),l=u(n),f=r,b=l["".concat(c,".").concat(f)]||l[f]||m[f]||a;return n?o.a.createElement(b,i(i({ref:t},s),{},{components:n})):o.a.createElement(b,i({ref:t},s))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=f;var i={};for(var p in t)hasOwnProperty.call(t,p)&&(i[p]=t[p]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var s=2;s<a;s++)c[s]=n[s];return o.a.createElement.apply(null,c)}return o.a.createElement.apply(null,n)}f.displayName="MDXCreateElement"},157:function(e,t,n){"use strict";n.r(t),t.default=n.p+"assets/images/react-server-component-223248abd8a39c27ba93b68b8cf5076f.png"}}]);