mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-24 05:05:53 +08:00
Move can i use decorators to its own file
This commit is contained in:
18
docusaurus/docs/can-i-use-decorators.md
Normal file
18
docusaurus/docs/can-i-use-decorators.md
Normal file
@@ -0,0 +1,18 @@
|
||||
---
|
||||
id: can-i-use-decorators
|
||||
title: Can I Use Decorators?
|
||||
---
|
||||
|
||||
Some popular libraries use [decorators](https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841) in their documentation.<br>
|
||||
Create React App intentionally doesn’t support decorator syntax at the moment because:
|
||||
|
||||
- It is an experimental proposal and is subject to change (in fact, it has already changed once, and will change again).
|
||||
- Most libraries currently support only the old version of the proposal — which will never be a standard.
|
||||
|
||||
However in many cases you can rewrite decorator-based code without decorators just as fine.<br>
|
||||
Please refer to these two threads for reference:
|
||||
|
||||
- [#214](https://github.com/facebook/create-react-app/issues/214)
|
||||
- [#411](https://github.com/facebook/create-react-app/issues/411)
|
||||
|
||||
Create React App will add decorator support when the specification advances to a stable stage.
|
||||
@@ -11,7 +11,6 @@ You can find the most recent version of this guide [here](https://github.com/fac
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Can I Use Decorators?](#can-i-use-decorators)
|
||||
- [Fetching Data with AJAX Requests](#fetching-data-with-ajax-requests)
|
||||
- [Integrating with an API Backend](#integrating-with-an-api-backend)
|
||||
- [Node](#node)
|
||||
@@ -27,22 +26,6 @@ You can find the most recent version of this guide [here](https://github.com/fac
|
||||
- [Advanced Configuration](#advanced-configuration)
|
||||
- [Alternatives to Ejecting](#alternatives-to-ejecting)
|
||||
|
||||
## Can I Use Decorators?
|
||||
|
||||
Some popular libraries use [decorators](https://medium.com/google-developers/exploring-es7-decorators-76ecb65fb841) in their documentation.<br>
|
||||
Create React App intentionally doesn’t support decorator syntax at the moment because:
|
||||
|
||||
- It is an experimental proposal and is subject to change (in fact, it has already changed once, and will change again).
|
||||
- Most libraries currently support only the old version of the proposal — which will never be a standard.
|
||||
|
||||
However in many cases you can rewrite decorator-based code without decorators just as fine.<br>
|
||||
Please refer to these two threads for reference:
|
||||
|
||||
- [#214](https://github.com/facebook/create-react-app/issues/214)
|
||||
- [#411](https://github.com/facebook/create-react-app/issues/411)
|
||||
|
||||
Create React App will add decorator support when the specification advances to a stable stage.
|
||||
|
||||
## Fetching Data with AJAX Requests
|
||||
|
||||
React doesn't prescribe a specific approach to data fetching, but people commonly use either a library like [axios](https://github.com/axios/axios) or the [`fetch()` API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) provided by the browser.
|
||||
|
||||
@@ -41,6 +41,9 @@
|
||||
"updating-to-new-releases",
|
||||
"sending-feedback",
|
||||
"something-missing"
|
||||
],
|
||||
"Frequently Asked Questions": [
|
||||
"can-i-use-decorators"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user