Fix #278: Replace mentions of render-component with render

This commit is contained in:
Juho Teperi 2017-03-10 17:19:19 +02:00
parent a7efb69a5e
commit 8630ab5239
6 changed files with 10 additions and 10 deletions

View File

@ -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.

View File

@ -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:

View File

@ -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 Reacts 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

View File

@ -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)))))

View File

@ -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)

View File

@ -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)))))