From 8630ab5239363e1bfe30d9caae36a7cb68f61038 Mon Sep 17 00:00:00 2001 From: Juho Teperi Date: Fri, 10 Mar 2017 17:19:19 +0200 Subject: [PATCH] Fix #278: Replace mentions of render-component with render --- CHANGELOG.md | 4 ++-- README.md | 4 ++-- demo/reagentdemo/intro.cljs | 6 +++--- demo/sitetools/core.cljs | 2 +- test/reagenttest/testreagent.cljs | 2 +- test/reagenttest/testwrap.cljs | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71763a7..4c7558f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -109,14 +109,14 @@ - Stop wrapping native components. This reduces the number of components created a lot, and can speed up some things substantially (especially render-to-string, that is not bound by browser performance). This is made possible by a new way of keeping track of which order to re-render dirty components. -- Added `create-element` to make it easier to embed native React +- Added `create-element` to make it easier to embed native React components in Reagent ones. - Arguments to components are now compared using simple `=`, instead of the old, rather complicated heuristics. **NOTE**: This means all arguments to a component function must be comparable with `=` (which means that they cannot be for example infinite `seq`s). - Reagent now creates all React components using `React.createElement` (required for React 0.12). -- `render-component` is now render, and `render-component-to-string` is `render-to-string`, in order to match React 0.12 (but the old names still work). +- `render-component` is now `render`, and `render-component-to-string` is `render-to-string`, in order to match React 0.12 (but the old names still work). - Add `render-to-static-markup`. This works exactly like `render-to-string`, except that it doesn't produce `data-react-id` etc. diff --git a/README.md b/README.md index 08b63c1..0257f68 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,8 @@ You mount the component into the DOM like this: ```clj (defn mountit [] - (r/render-component [childcaller] - (.-body js/document))) + (r/render [childcaller] + (.-body js/document))) ``` assuming we have imported Reagent like this: diff --git a/demo/reagentdemo/intro.cljs b/demo/reagentdemo/intro.cljs index 8f51335..9be87de 100644 --- a/demo/reagentdemo/intro.cljs +++ b/demo/reagentdemo/intro.cljs @@ -65,8 +65,8 @@ "Seconds Elapsed: " @seconds-elapsed]))) (defn render-simple [] - (r/render-component [simple-component] - (.-body js/document))) + (r/render [simple-component] + (.-body js/document))) (def bmi-data (r/atom {:height 180 :weight 80})) @@ -225,7 +225,7 @@ [:p "Reagent supports most of React’s API, but there is really only one entry-point that is necessary for most applications: " - [:code "reagent.core/render-component"] "."] + [:code "reagent.core/render"] "."] [:p "It takes two arguments: a component, and a DOM node. For example, splashing the very first example all over the page would diff --git a/demo/sitetools/core.cljs b/demo/sitetools/core.cljs index 7bdfe12..e81ac1c 100644 --- a/demo/sitetools/core.cljs +++ b/demo/sitetools/core.cljs @@ -186,4 +186,4 @@ conf (swap! config merge page-conf) {:keys [page-path body main-div]} conf] (init-history page-path) - (r/render-component body (js/document.getElementById main-div))))) + (r/render body (js/document.getElementById main-div))))) diff --git a/test/reagenttest/testreagent.cljs b/test/reagenttest/testreagent.cljs index 6e1dab0..81e4a9b 100644 --- a/test/reagenttest/testreagent.cljs +++ b/test/reagenttest/testreagent.cljs @@ -32,7 +32,7 @@ (defn with-mounted-component [comp f] (when isClient (let [div (add-test-div "_testreagent")] - (let [c (r/render-component comp div)] + (let [c (r/render comp div)] (f c div) (r/unmount-component-at-node div) (r/flush) diff --git a/test/reagenttest/testwrap.cljs b/test/reagenttest/testwrap.cljs index 59b6cdc..8c01bb9 100644 --- a/test/reagenttest/testwrap.cljs +++ b/test/reagenttest/testwrap.cljs @@ -13,7 +13,7 @@ (defn with-mounted-component [comp f] (when r/is-client (let [div (add-test-div "_testreagent")] - (let [comp (r/render-component comp div #(f comp div))] + (let [comp (r/render comp div #(f comp div))] (r/unmount-component-at-node div) (r/flush) (.removeChild (.-body js/document) div)))))