Skip to content

Commit f4d9d8d

Browse files
authored
Add a note on decorators
1 parent 4534fd0 commit f4d9d8d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

template/README.md

+18
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ You can find the most recent version of this guide [here](https://github.com/fac
2222
- [Adding Bootstrap](#adding-bootstrap)
2323
- [Adding Flow](#adding-flow)
2424
- [Adding Custom Environment Variables](#adding-custom-environment-variables)
25+
- [Can I Use Decorators?](#can-i-use-decorators)
2526
- [Integrating with a Node Backend](#integrating-with-a-node-backend)
2627
- [Proxying API Requests in Development](#proxying-api-requests-in-development)
2728
- [Using HTTPS in Development](#using-https-in-development)
@@ -457,6 +458,23 @@ if (process.env.NODE_ENV !== 'production') {
457458
}
458459
```
459460
461+
## Can I Use Decorators?
462+
463+
Many popular libraries use [decorators](https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841) in their documentation.
464+
Create React App doesn’t support decorator syntax at the moment because:
465+
466+
* It is an experimental proposal and is subject to change.
467+
* The current specification version is not officially supported by Babel.
468+
* If the specification changes, we won’t be able to write a codemod because we don’t use them internally at Facebook.
469+
470+
However in many cases you can rewrite decorator-based code without decorators just as fine.
471+
Please refer to these two threads for reference:
472+
473+
* [#214](https://github.com/facebookincubator/create-react-app/issues/214)
474+
* [#411](https://github.com/facebookincubator/create-react-app/issues/411)
475+
476+
Create React App will add decorator support when the specification advances to a stable stage.
477+
460478
## Integrating with a Node Backend
461479
462480
Check out [this tutorial](https://www.fullstackreact.com/articles/using-create-react-app-with-a-server/) for instructions on integrating an app with a Node backend running on another port, and using `fetch()` to access it. You can find the companion GitHub repository [here](https://github.com/fullstackreact/food-lookup-demo).

0 commit comments

Comments
 (0)