Fork me on GitHub

hey, currently playing with re-natal, anyone else is getting this overwriting an event-handler for etc… message


I remember last time I played with it, probably a couple of weeks ago I could just go modify (def app-db {:greeting "Hello Clojure in iOS and Android!”}), save and would see it update on the iOS simulator, not the case anymore


If I would go change press me to something else and save it would then update the button title in the iOS simulator


i guess it’s more something to do with re-frame simple_smile


@anthonymittaz: I think the warning about overwriting is coming from re-frame when handlers namespace is reloaded. The app-db you mentioned is only used to initialized app db managed by re-frame so if you change that after app state is initialized nothing happens because the real atom is slill same. You have to publish events to change the app state after it is initialized. So this is expected behavior I think.


Maybe before you tried with Om.Next? There you can redefine the atom value by reloading I guess


Thanks it makes sense. Don't remember if I used reagent or else, all good 😎


good day, gentlemen Some data on DataScript performing on iphone 5 device (≠ simulator, ≠ 5s, ≠ 5se): Following is a log sample, where each row represents a DS d/transact! transaction of 1–5 datoms (creating entities/linking them/setting attributes). Running application with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF

db=> (count (d/datoms @DB :avet))

2016-04-11 13:32:56.836
2016-04-11 13:32:56.879
2016-04-11 13:32:56.890
2016-04-11 13:32:56.901
2016-04-11 13:32:56.909
2016-04-11 13:32:56.917
2016-04-11 13:32:56.927
2016-04-11 13:32:56.941
2016-04-11 13:32:56.949
2016-04-11 13:32:56.958
2016-04-11 13:32:56.966
2016-04-11 13:32:56.975
2016-04-11 13:32:56.987
2016-04-11 13:32:56.996
2016-04-11 13:32:57.007
2016-04-11 13:32:57.014
2016-04-11 13:32:57.020
2016-04-11 13:32:57.028
2016-04-11 13:32:57.035
db=> (count (d/datoms @DB :avet))

2016-04-10 18:23:29.655
2016-04-10 18:23:29.763
2016-04-10 18:23:29.867
2016-04-10 18:23:29.972
2016-04-10 18:23:30.077
2016-04-10 18:23:30.189
2016-04-10 18:23:30.293
2016-04-10 18:23:30.394
2016-04-10 18:23:30.496
2016-04-10 18:23:30.595
2016-04-10 18:23:30.693
2016-04-10 18:23:30.794
2016-04-10 18:23:30.901


is it possible to send off some js execution to a separate thread in RN? swap!ing an atom visible in the main thread would be sweet simple_smile


I only know how to do that via Native Modules


Here is a document on Native Modules that also talks about backgrounding stuff with dispatch_async on iOS


I have a minimal repo for the problem I’m seeing with re-natal and


@drapanjanas: has anyone mentioned this happening? variables from other namespaces all being bound to nil after a defui call?


Or anyone else who is using re-natal and together? This is a really unavoidable problem so I’m baffled that I’m seeing it. I’m using Genymotion by the way


so the same code in the ios simulator throws an Evaluation Error, whereas the Android simulator shows no error, or swallows it. That’s my first clue I guess


it turns out that the problem I had was the js/React was not being set before being used. It was easy to find in the iOS simulator, but because the Android emulator swallowed the error I didn’t realize that’s what I was running into


@adamfrey: glad you have sorted that out. To be honest I have experimented with Om.Next just enough to add the working template to re-natal. So not much of an expert with that simple_smile


@vikeri: Coming back to my question about react-native-router-flux, since I could not find a way to use it in Reagent, how did you approach using NavigationExperimental? Did you import all the relevant components, or did you just drew inspiration to re-implement the basic features with re-frame? Following the docs on NavigationExperimental it looks like you have to use specific Js patterns that do not translate immediately into Reagent, right?


@stepugnetti: I have it working in Reagent. And the 3.x branch is using NavigationExperimental.


@seantempesta: Great! I’d love to see the details, or at least some hints. Have you any link to point me to? I succeeded in importing the components in Reagent, but then I cannot compose them into new components, or my app crashes...


Hmm, I don’t have a complete working standalone version of the code, but I pulled out the relevant parts from my app in a gist for you


you’re welcome!


oh, all the defstate and deref’ing is because I’m using mount for system management. Highly recommended btw.


Thanks for this link as well, I need give it a look, too.


Yeah, it’s really awesome. I’ve moved all react requires over to it so you only pay the cost of loading libraries when you actually use them. Really sped up my application start times.


Not to mention not having to think about dependency ordering. I put my datascript dbs on there too and I don’t even have to think about initialization anymore.


Cool! Coming back to your gist, at a first glance it seems that what you have done is what was working for me, too. I had big troubles, though, when I tried to redefine the route component so as to change the key names in the option map, like:

(def route* (adapt-react-class (.-Scene js/ReactNativeRouterFlux)))
(defn route
  [opts & children]
  (into [route* (some-changes-to opts)] children]))
Apparently Reagent was no longer transforming it correctly when as-element is called on it, and as a result Router throws an error at runtime… Have you ever used imported components like this?


Hmm. I’m not sure I’m following you. Why are you changing the key names in the option map?


There is a good reason. My code should target both a mobile and a browser: the core code should be the same, just some symbols should have different definitions for the two platforms. Now, I found a nice component ReactRouter, that kind-of works with Reagent. So now I would like to have the same api for the mobile, and react-nativroutefluxwould be the perfect match. They have different names for some properties though: for instance. the keyproperty becomes pathon the other side.


Well, you can also just declare you scenes dynamically. Maybe just write a function to do it at app start? [from react-native-router-flux]:

const scenes = Actions.create(
            <Scene key="root">
                <Scene key="login" component={Login} title="Login"/>
                <Scene key="register" component={Register} title="Register"/>
                <Scene key="home" component={Home}/>
class App extends React.Component {
    render() {
        return <Router scenes={scenes}/>


I read this in react-native-router-flux Readme, but I’m not sure this can help with my problem. I still need to compose Router, or Scene, and this will make the app crash...


Not sure I’m following…again…sorry. You’re saying that if you build your routes at runtime it will cause the app to crash? Why?


Hi, can anyone point to sample Reagent code that makes use of the Navigator on Android? I have used the facebook Movies project as an example ( but I cannot get it to work... There are no errors, but the contents I add to Navigator never shows. The Navigator fills the screen (I have confirmed by setting its background-color)


I have tried various combinations of [view], [scroll-view] as children, specified specific heights, flex, etc.