mirror of
https://github.com/status-im/reagent.git
synced 2025-01-14 13:54:08 +00:00
Update Readme for 0.4.0
This commit is contained in:
parent
432592955f
commit
2f63be8823
11
README.md
11
README.md
@ -19,7 +19,7 @@ to the *:compiler* section of project.clj, as shown in the examples
|
|||||||
directory (or "reagent/react.min.js" in production). You could also
|
directory (or "reagent/react.min.js" in production). You could also
|
||||||
add
|
add
|
||||||
|
|
||||||
<script src="http://fb.me/react-0.8.0.js"></script>
|
<script src="http://fb.me/react-0.9.0.js"></script>
|
||||||
|
|
||||||
directly to your html.
|
directly to your html.
|
||||||
|
|
||||||
@ -49,12 +49,11 @@ You can use one component inside another:
|
|||||||
And pass properties from one component to another:
|
And pass properties from one component to another:
|
||||||
|
|
||||||
```clj
|
```clj
|
||||||
(defn child [props]
|
(defn child [name]
|
||||||
[:p "Hi, I am "
|
[:p "Hi, I am " name])
|
||||||
(:name props)])
|
|
||||||
|
|
||||||
(defn childcaller []
|
(defn childcaller []
|
||||||
[child {:name "Foo"}])
|
[child "Foo Bar"])
|
||||||
```
|
```
|
||||||
|
|
||||||
You mount the component into the DOM like this:
|
You mount the component into the DOM like this:
|
||||||
@ -102,7 +101,7 @@ But you can still use them if you want to, either using `reagent.core/create-cla
|
|||||||
```clj
|
```clj
|
||||||
(def my-html (atom ""))
|
(def my-html (atom ""))
|
||||||
|
|
||||||
(defn plain-component [props this]
|
(defn plain-component []
|
||||||
[:p "My html is " @my-html])
|
[:p "My html is " @my-html])
|
||||||
|
|
||||||
(def component-with-callback
|
(def component-with-callback
|
||||||
|
Loading…
x
Reference in New Issue
Block a user