Useless caveat about root element in a component

With new version of React (v16), many root element are acceptable.
This commit is contained in:
Michel EDIGHOFFER
2017-10-24 17:22:47 +02:00
committed by GitHub
parent bea8fa0dd6
commit bcbf2a464c

View File

@@ -122,10 +122,6 @@ ReactDOM.render(
Typically, new React apps have a single `App` component at the very top. However, if you integrate React into an existing app, you might start bottom-up with a small component like `Button` and gradually work your way to the top of the view hierarchy.
>**Caveat:**
>
>Components must return a single root element. This is why we added a `<div>` to contain all the `<Welcome />` elements.
## Extracting Components
Don't be afraid to split components into smaller components.