This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-24
Channels
- # admin-announcements (2)
- # beginners (46)
- # boot (8)
- # cider (29)
- # cljs-dev (45)
- # cljsjs (10)
- # cljsrn (13)
- # clojure (60)
- # clojure-dev (5)
- # clojure-greece (1)
- # clojure-ireland (4)
- # clojure-mexico (6)
- # clojure-poland (3)
- # clojure-quebec (3)
- # clojure-russia (8)
- # clojure-spec (89)
- # clojure-uk (70)
- # clojurescript (84)
- # cursive (4)
- # datomic (7)
- # devcards (1)
- # dirac (2)
- # emacs (11)
- # hispano (10)
- # jobs (13)
- # keechma (34)
- # lein-figwheel (4)
- # luminus (19)
- # off-topic (2)
- # om (78)
- # onyx (6)
- # parinfer (1)
- # planck (82)
- # proton (2)
- # re-frame (10)
- # reagent (23)
- # ring-swagger (5)
- # spacemacs (2)
- # specter (24)
- # spirituality-ethics (122)
- # untangled (13)
guys, i am having issues writing a custom component that still maintains hiccup format. this code here looks a bit wrong to me:
how would you rewrite this? maybe make use of apply? no idea here … thx!
guys, what happen with Form 2 reagent components (actually with re-frame subscribes) when they unmounted? What happened with ratoms?
quick question. I’m trying to use react-native’s animated api, and it depends on using mutable vars. Is there a way to do this in reagent?
class FadeInView extends React.Component {
constructor(props) {
super(props);
this.state = {
fadeAnim: new Animated.Value(0), // init opacity 0
};
}
componentDidMount() {
Animated.timing( // Uses easing functions
this.state.fadeAnim, // The value to drive
{toValue: 1} // Configuration
).start(); // Don't forget start!
}
render() {
return (
<Animated.View // Special animatable View
style={{opacity: this.state.fadeAnim}}> // Binds
{this.props.children}
</Animated.View>
);
}
}
@seantempesta: I’m just using wrappers around Animated)
and yeah this is mutable vars
yeah, I figured it out. Here’s what I did:
(defn fading-image-circle [width height image-uri]
(let [opacity (AnimatedValue. 0)]
(fn [width height image-uri]
[animated-image {:source {:uri image-uri}
:style {:width width
:borderRadius (/ width 2)
:height height
:opacity opacity}
:onLoad #(.start (.timing Animated opacity #js {:toValue 1}))}])))
I’m using this:
(defn start-animated-timing
([animated-value config]
(.. Animated (timing animated-value (clj->js config)) (start)))
([animated-value config end-cb]
(.. Animated (timing animated-value (clj->js config)) (start #(end-cb)))))
anyone some pointers regarding using reagent components inside an Om app?
I haven't actually done that @martinklepsch but what I would probably do since Om supports native react is just reactify the reagent components then use them
not sure if there is a direct way with markup from both in the same component...seems like that might be bad anyway
@mitchelkuijpers: told me about this: (reagent/as-element [my-comp {:arg 1}])
which works great for him
thats what I would do as well
I ended up trying Rum as well which just worked
just treat it as a external react component
I tried as-element
before but I somehow thought it would not need the vector-wrapping which made it break 🙂
ooh 🙂
I pretty much need to use as-element
with any wrapping lib say...react-infinite...react-virtualized..because they end up taking child react components
and you cant just jam in reagent
wrapping lib to be more clear I mean... parent container that acts on child react components
I haven't measured the performance or if there is extra rendering cycles or something but I doubt there is