Hello, I hope this is the right channel to ask this question. I'm working on a project that uses krell and reagent + react-native I need to translate this code but I don't understand how to do that
<Animated.View
style={[
styles.fadingContainer,
{
// Bind opacity to animated value
opacity: fadeAnim,
},
]}>
<Text style={styles.fadingText}>Fading View!</Text>
</Animated.View>
Any suggestions? Thanks!Hi @gabriele.lippi91! Welcome to the React Native family! There are several steps needed to translate this code:
1. Animated.View -> (.View
2. Style is just a map, so you can manipulate it just like a CLJS map.
3. Don’t forget to use the clj->js function to convert your map into a JS map.
Let me know if you need more information.
First of all thank you very much @hadilsabbagh18!
I'm afraid I still don't have clear how to import in particular for Animated.View I'm trying this but it seems to be wrong still
(ns some-name-space
(:require
[reagent.core :as reagent]
[react-native :as rn]))
(defn animated-view []
[:> (.View rn/Animated)])Ideally I'm trying to have something similar to this:
(def text (r/adapt-react-class rn/Text))View is a property of Animated, so it should be something like (.-View rn/Animated)