This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-29
Channels
- # aleph (1)
- # announcements (10)
- # aws (1)
- # beginners (110)
- # calva (4)
- # cider (26)
- # clj-kondo (14)
- # cljdoc (24)
- # cljsrn (16)
- # clojure (76)
- # clojure-europe (3)
- # clojure-ireland (2)
- # clojure-italy (15)
- # clojure-nl (8)
- # clojure-spec (23)
- # clojure-sweden (4)
- # clojure-uk (92)
- # clojurescript (37)
- # cursive (19)
- # datomic (59)
- # duct (1)
- # emacs (4)
- # fulcro (7)
- # graalvm (7)
- # graphql (1)
- # hoplon (69)
- # jobs (4)
- # jobs-rus (1)
- # kaocha (2)
- # leiningen (5)
- # luminus (2)
- # pathom (8)
- # reagent (6)
- # reitit (11)
- # spacemacs (12)
- # sql (3)
- # tools-deps (9)
- # unrepl (1)
- # vim (57)
Hi! I’m trying to use react-native-view-overflow but I’m not sure how to type the required code in ClojureScript. I have the following inside one of my view components:
[:> rn/FlatList
{:data (clj->js (mapv (fn [n] {:key n}) (range 0 100)))
:horizontal true
;; :Item-separator-component #(r/as-element [separator])
:render-item (fn [details] (r/as-element [cell (js->clj details)]))}]
According to the docs (https://github.com/entria/react-native-view-overflow#usage-with-flatlist) I need to wrap whatever I put into render-item
with ViewOverflow
. Just making the first thing in cell
a ViewOverflow
doesn’t seem to do the job…For completeness, this is cell
:
(defn cell [details]
(let [item (details "item")
key (item "key")]
[:> rn/View {:style {:width 80
:background-color (if (= 0 (mod key 2)) "#dd666611" "#ffffff33")}}
[:> rn/Text {:style {:left -15 :width 30 :text-align "center"}} key]]))
(My question was answered in #cljsrn: https://clojurians.slack.com/archives/C0E1SN0NM/p1559143035056100)