mirror of https://github.com/status-im/reagent.git
Mention React Fragments
This commit is contained in:
parent
509dc90e08
commit
b87a9ec4df
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue