PageSourceSearch

https://create-react-app.dev/assets/js/e543a104.c60d0c30.js

js create-react-app.dev collected 2026-09-24 07:30:36 UTC 4,743 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkcra_docs=self.webpackChunkcra_docs||[]).push([[9176],{876:function(e,t,r){r.d(t,{Zo:function(){return u},kt:function(){return f}});var n=r(2784);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function i(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var s=n.createContext({}),l=function(e){var t=n.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},u=function(e){var t=l(e.components);return n.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,s=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),d=l(r),f=a,m=d["".concat(s,".").concat(f)]||d[f]||p[f]||o;return r?n.createElement(m,c(c({ref:t},u),{},{components:r})):n.createElement(m,c({ref:t},u))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,c=new Array(o);c[0]=d;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i.mdxType="string"==typeof e?e:a,c[1]=i;for(var l=2;l<o;l++)c[l]=r[l];return n.createElement.apply(null,c)}return n.createElement.apply(null,r)}d.displayName="MDXCreateElement"},9015:function(e,t,r){r.r(t),r.d(t,{frontMatter:function(){return i},contentTitle:function(){return s},metadata:function(){return l},toc:function(){return u},default:function(){return d}});var n=r(7896),a=r(1461),o=(r(2784),r(876)),c=["components"],i={id:"can-i-use-decorators",title:"Can I Use Decorators?"},s=void 0,l={unversionedId:"can-i-use-decorators",id:"can-i-use-decorators",title:"Can I Use Decorators?",description:"Some popular libraries use decorators in their documentation.",source:"@site/../docs/can-i-use-decorators.md",sourceDirName:".",slug:"/can-i-use-decorators",permalink:"/docs/can-i-use-decorators",editUrl:"https://github.com/facebook/create-react-app/edit/main/docusaurus/website/../docs/can-i-use-decorators.md",tags:[],version:"current",lastUpdatedBy:"Ian Sutherland",lastUpdatedAt:1571940855,formattedLastUpdatedAt:"10/24/2019",frontMatter:{id:"can-i-use-decorators",title:"Can I Use Decorators?"},sidebar:"docs",previous:{title:"Custom Templates",permalink:"/docs/custom-templates"},next:{title:"Pre-Rendering Static HTML",permalink:"/docs/pre-rendering-into-static-html-files"}},u=[],p={toc:u};function d(e){var t=e.components,r=(0,a.Z)(e,c);return(0,o.kt)("wrapper",(0,n.Z)({},p,r,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"Some popular libraries use ",(0,o.kt)("a",{parentName:"p",href:"https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841"},"decorators")," in their documentation."),(0,o.kt)("p",null,"Create React App intentionally doesn\u2019t support decorator syntax at the moment because:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"It is an experimental proposal and is subject to change (in fact, it has already changed once, and will change again)."),(0,o.kt)("li",{parentName:"ul"},"Most libraries currently support only the old version of the proposal \u2014 which will never be a standard.")),(0,o.kt)("p",null,"However in many cases you can rewrite decorator-based code without decorators and achieve the same result."),(0,o.kt)("p",null,"Please refer to these two threads for reference:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/facebook/create-react-app/issues/214"},"#214")),(0,o.kt)("li",{parentName:"ul"},(0,o.kt)("a",{parentName:"li",href:"https://github.com/facebook/create-react-app/issues/411"},"#411"))),(0,o.kt)("p",null,"Create React App will add decorator support when the specification advances to a 
1stable stage."))}d.isMDXComponent=!0}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.