Fork me on GitHub

Hi all. I’m new to fulcro. Has anyone used fulcro on a React Native app without Expo? I’m having a hard time getting a root component from fulcro that I can give to React Native’s AppRegistry.registerComponent.

(ns core
  (:require [reagent.core :as r]
            [reagent.react-native :as rn]
            [com.sisterical.template.list-app.log :as log]
            [com.fulcrologic.fulcro.components :as comp :refer [defsc]]
            [com.fulcrologic.fulcro.mutations :refer [defmutation]]
            [com.fulcrologic.fulcro.rendering.keyframe-render :as kr]
            [com.fulcrologic.fulcro.application :as app]))

(defmutation bump-number [ignored]
  (action [{:keys [state]}]
          (swap! state update :ui/number inc)))

(defsc Component [this {:ui/keys [number]}]
  {:query         [:ui/number]
   :initial-state {:ui/number 0}}
  [rn/view {:style {:flex 4}}
   [rn/text {} "This is an example."]
    (str "You've clicked this button " number " times.")]])

(def ui-component (comp/factory Component))
(def ui-component-class (r/create-class {:render (ui-component)}))

(def fulcro-app
      {:optimized-render! kr/render!
       :render-root!      ui-component-class}

(.registerComponent rn/AppRegistry "app" ui-component))
This code gives me a fulcro error: “Fulcro component was rendered outside of a parent context. Use with-parent-context” ( but I don’t have a parent context…


Look at the native lib. Yes, it uses expo, but it also shows you how to set up root render…you cannot just pass a factory like that.


What exactly does it do when I add the ::auth/authority to a defattr?

Jakub Holý13:05:07

Perhaps nothing? Auth was quite work in progress....


Not much 😜


The idea is that attributes will come from some server, and there might be different authorities you have to sign on with to get access (e.g. GitHub + Facebook + Google because you use APIs to integrate things from all three, like an app that lets you do social networking about your open-source project from GitHub while you save an image to google photos while posting it to Facebook???). The ultimate idea is that data is federated, and a single bag of attributes may not live under one single authority. But I have no implementation to speak of for it.


Ah I see! Thanks 🙂


It seems like the most recent fulcro-rad-demo is not using it anymore

Eric Ihli18:05:14

What would cause fulcro inspect to get stuck trying to load index? When I refresh the page, I see some initial data in the DB tab. As soon as I click on the query or index explorer tab, it shows a "loading..." message indefinitely.


There may be errors in the inspector, you can open the devtools for the inspector to see the log messages


Other than that I've seen :parallel true loads never get resolved in the inspector


they always show pending... but i'm not sure that's related

Eric Ihli19:05:06

I'll check the logs. I just created a gif of the behavior.

Eric Ihli19:05:51

Don't see any errors in the dev tools of the plugin.


very strange- if you have logs on your server those eql calls should be coming in


to ask for the indexes


Hey, thanks for such an amazing paradigm for doing UI dev. I am starting out with some basic applications. Just a trivial question and something that might have already been answered before, why are event handlers named onClick instead of on-click , also things like shouldComponentUpdate? It has been bugging me to see camel case mixed with kebab case in my code.


fulcro passes those props to react which expects them in camel case. I highly recommend using if you like kebab


it also cuts down on visual noise in larger components (dom/div :.ui.classname -> [:.ui.classname


Thanks, yes I understand it has to pass them to react. Would have been nice if fulcro camel cased them and then passed it to react. WIll checkout sablono thank you!