Mention React Fragments

This commit is contained in:
Juho Teperi 2019-05-23 21:00:24 +03:00 committed by GitHub
parent 509dc90e08
commit b87a9ec4df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

View File

@ -3,6 +3,32 @@
Most React features should be usable from Reagent, even if Reagent doesn't
provide functions to use them directly.
## [Fragments](https://reactjs.org/docs/fragments.html)
JSX:
```js
render() {
return (
<React.Fragment>
<ChildA />
<ChildB />
<ChildC />
</React.Fragment>
);
}
```
Reagent:
```cljs
(defn example []
[:<>
[child-a]
[child-b]
[child-c]])
```
Reagent syntax follows [React Fragment short syntax].
## Context
```cljs