This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-22
Channels
- # announcements (2)
- # aws (5)
- # babashka (17)
- # beginners (108)
- # calva (28)
- # chlorine-clover (7)
- # clj-kondo (14)
- # cljs-dev (9)
- # cljsrn (2)
- # clojure (118)
- # clojure-europe (50)
- # clojure-finland (5)
- # clojure-france (15)
- # clojure-italy (9)
- # clojure-nl (14)
- # clojure-spec (11)
- # clojure-uk (43)
- # clojuredesign-podcast (1)
- # clojurescript (35)
- # clojutre (2)
- # clr (3)
- # community-development (6)
- # conjure (9)
- # core-async (41)
- # cursive (7)
- # data-science (7)
- # datomic (11)
- # events (1)
- # figwheel-main (4)
- # fulcro (20)
- # ghostwheel (9)
- # graalvm (18)
- # helix (46)
- # leiningen (14)
- # observability (2)
- # off-topic (23)
- # pathom (4)
- # re-frame (5)
- # reitit (5)
- # rum (2)
- # shadow-cljs (32)
- # spacemacs (8)
- # specter (5)
- # sql (36)
- # timbre (3)
- # vim (15)
- # xtdb (2)
- # yada (2)
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."]
[rn/touchable-highlight
{}
(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
(app/fulcro-app
(merge
{: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” (https://github.com/fulcrologic/fulcro/blob/53fa8881a1875deb3785a99a351787c55181c1eb/src/main/com/fulcrologic/fulcro/components.cljc#L853) 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.
Perhaps nothing? Auth was quite work in progress....
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.
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
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 https://github.com/r0man/sablono 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!