This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-08
Channels
- # admin-announcements (3)
- # bangalore-clj (3)
- # beginners (21)
- # boot (32)
- # cider (14)
- # clara (2)
- # cljs-dev (19)
- # cljsjs (8)
- # cljsrn (1)
- # clojars (1)
- # clojure (147)
- # clojure-australia (6)
- # clojure-brasil (8)
- # clojure-canada (2)
- # clojure-gamedev (3)
- # clojure-greece (2)
- # clojure-hk (5)
- # clojure-italy (10)
- # clojure-japan (8)
- # clojure-korea (4)
- # clojure-russia (25)
- # clojure-sg (2)
- # clojure-spec (36)
- # clojure-uk (34)
- # clojurescript (88)
- # cursive (157)
- # datomic (6)
- # devcards (1)
- # dirac (1)
- # editors-rus (3)
- # events (2)
- # funcool (1)
- # hoplon (57)
- # jobs (9)
- # lein-figwheel (2)
- # luminus (1)
- # om (156)
- # onyx (93)
- # perun (11)
- # rdf (65)
- # re-frame (36)
- # reagent (17)
- # ring-swagger (3)
- # specter (19)
- # untangled (33)
I got a Wiki page for Respo's SSR solution here https://github.com/Respo/respo/wiki/SSR I think this feature is challenging for React.js based solutions since React.js does not expose virtual DOM to developers. (For people who don't know Respo, it's a pure ClojureScript implementation of virtual DOM library.)
I have a question about "named children", like in https://github.com/andyfenelon/react-native-UIKit#grid. How do I add the subcomponents to that, in this case the headerContent and the footerContent?
@brolund If I understand correctly these are all passed as props so you just need to pass a javascript hashmap to the component
[Grid #js {:headerContent ... :footerContent ...}]
that [Grid ...
constructor thing is probably wrong, I can never remember how to use ordinary React components in Reagent
@martinklepsch: Thanks for your answer. I'm trying some variations on this, to no avail:
(def ReactNativeUIKit (js/require "react-native-uikit"))
(def grid (.-Grid ReactNativeUIKit))
...
[grid #js {
:images [{:id 0, :src "file:///data/user/0/com.adomain/cache/IMG_20160906_145802-1721123790.jpg"}]
:headerContent (fn [] [view [text "Header text"]])
:footerContent (fn [] [view [text "Footer text"]])
}
]
Any pointers to where I go wrong are welcome. A more detailed explanation of your ... even more so. 😉I think this (def grid (.-Grid ReactNativeUIKit))
doesn't work just like that but I also don't remember how to do it
I've also tried
(def grid (r/adapt-react-class (.-Grid ReactNativeUIKit)))
for the declaration, same results i.e. nothing.try r/as-element
as well
@brolund unfortunately I don't have any specific suggestions beyond that but probably someone else will chime in later
Tried this search for examples but to much react native reloader stuff to see through the woods https://github.com/search?q=as-element+extension%3Acljs&type=Code&utf8=%E2%9C%93
Thanks. Yeah, I've google quite a bit, finding bits and pieces, but not understanding the whole picture just yet. 🙂
(def ReactNativeUIKit (js/require "react-native-uikit"))
(def grid (.-Grid ReactNativeUIKit))
[grid #js {
:images (js/Array #js{:id 0 :src ""})
:headerContent (r/as-element [view [text "Header content"]])
:footerContent (r/as-element [view [text "Footer content"]])
:itemsPerRow 4
:spacing 1
}]
...got the header and footer working. Yay! 🙂 Now I just cannot get the actual image grid working... 😛nice! 👍
Yeah 🙂 But now I really don't understand what the problem is. 😉 Reading the code the image array should be just fine, but nothing shows...
try #js [ #js {} ]