mirror of
https://github.com/status-im/reagent.git
synced 2025-01-26 20:01:02 +00:00
improve docs about using portal
This commit is contained in:
parent
9165f0b724
commit
c76bdb142b
@ -162,16 +162,10 @@ as properties into the React function component.
|
||||
|
||||
```cljs
|
||||
(defn reagent-component []
|
||||
(r/create-class
|
||||
{:render (fn [this]
|
||||
(let [el (.. js/document (getElementById "portal-el"))]
|
||||
(react-dom/createPortal (r/as-element [:div "foo"]) el)))}))
|
||||
|
||||
(let [el (.. js/document (getElementById "portal-el"))]
|
||||
(react-dom/createPortal (r/as-element [:div "foo"]) el)))
|
||||
```
|
||||
|
||||
TODO: Can this be done without create-class and `:render`.
|
||||
TODO: This might have problems handling Ratoms, test.
|
||||
|
||||
## [Hydrate](https://reactjs.org/docs/react-dom.html#hydrate)
|
||||
|
||||
```cljs
|
||||
|
Loading…
x
Reference in New Issue
Block a user