From c873aed5ea32fea71cc5efc29cdb44e852ef6601 Mon Sep 17 00:00:00 2001 From: boxp Date: Sun, 9 Dec 2018 04:41:25 +0900 Subject: [PATCH] =?UTF-8?q?Update=20InteropWithReact.md=20for=20"Don?= =?UTF-8?q?=E2=80=99t=20Use=20HOCs=20Inside=20the=20render=20Method"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/InteropWithReact.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/InteropWithReact.md b/doc/InteropWithReact.md index fd3e6d0..3a76a52 100644 --- a/doc/InteropWithReact.md +++ b/doc/InteropWithReact.md @@ -94,11 +94,10 @@ Note: Some React libraries use the decorator pattern: a React component which takes a component as an argument and returns a new component as its result. One example is the React DnD library. We will need to use both `adapt-react-class` and `reactify-component` to move back and forth between React and reagent: ```clojure -(defn react-dnd-component - [] +(def react-dnd-component (let [decorator (DragDropContext HTML5Backend)] - [(reagent/adapt-react-class - (decorator (reagent/reactify-component top-level-component)))])) + (reagent/adapt-react-class + (decorator (reagent/reactify-component top-level-component))))) ``` This is the equivalent javascript: