mirror of
https://github.com/tonsky/rum.git
synced 2025-08-03 18:13:19 +08:00
Updated README as repeat is not directly supported by newest CLJS (closes #166)
This commit is contained in:
@ -165,7 +165,7 @@ Given this code:
|
||||
(require [rum.core :as rum])
|
||||
|
||||
(rum/defc repeat-label [n text]
|
||||
[:div (repeat n [:.label text])])
|
||||
[:div (vec (repeat n [:.label text]))])
|
||||
```
|
||||
|
||||
First, we need to create a component instance by calling its function:
|
||||
@ -262,7 +262,7 @@ If your component accepts only immutable data structures as arguments, it may be
|
||||
|
||||
```clojure
|
||||
(rum/defc label < rum/static [n text]
|
||||
[:.label (repeat n text)])
|
||||
[:.label (vec (repeat n text))])
|
||||
```
|
||||
|
||||
`rum.core/static` will check if the arguments of a component’s constructor have changed (using Clojure’s `-equiv` semantic), and if they are the same, avoid re-rendering.
|
||||
|
Reference in New Issue
Block a user