From c76bdb142bd49e105619d0f5c7d8db0cde8d3d63 Mon Sep 17 00:00:00 2001 From: Lucy Wang Date: Thu, 16 Apr 2020 01:23:22 +0800 Subject: [PATCH] improve docs about using portal --- doc/ReactFeatures.md | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/doc/ReactFeatures.md b/doc/ReactFeatures.md index 666e964..766338a 100644 --- a/doc/ReactFeatures.md +++ b/doc/ReactFeatures.md @@ -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