Skip to content

Commit

Permalink
Add a note on decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored and George Czabania committed Sep 7, 2016
1 parent 2e4dba8 commit 1a2b61c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ You can find the most recent version of this guide [here](https://github.com/fac
- [Adding Bootstrap](#adding-bootstrap)
- [Adding Flow](#adding-flow)
- [Adding Custom Environment Variables](#adding-custom-environment-variables)
- [Can I Use Decorators?](#can-i-use-decorators)
- [Integrating with a Node Backend](#integrating-with-a-node-backend)
- [Proxying API Requests in Development](#proxying-api-requests-in-development)
- [Using HTTPS in Development](#using-https-in-development)
Expand Down Expand Up @@ -457,6 +458,23 @@ if (process.env.NODE_ENV !== 'production') {
}
```
## Can I Use Decorators?
Many popular libraries use [decorators](https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841) in their documentation.
Create React App doesn’t support decorator syntax at the moment because:
* It is an experimental proposal and is subject to change.
* The current specification version is not officially supported by Babel.
* If the specification changes, we won’t be able to write a codemod because we don’t use them internally at Facebook.
However in many cases you can rewrite decorator-based code without decorators just as fine.
Please refer to these two threads for reference:
* [#214](https://github.com/facebookincubator/create-react-app/issues/214)
* [#411](https://github.com/facebookincubator/create-react-app/issues/411)
Create React App will add decorator support when the specification advances to a stable stage.
## Integrating with a Node Backend
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).
Expand Down

0 comments on commit 1a2b61c

Please sign in to comment.