This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-08-26
Channels
- # announcements (6)
- # beginners (88)
- # calva (12)
- # cider (13)
- # cljs-dev (27)
- # cljsrn (2)
- # clojure (68)
- # clojure-argentina (2)
- # clojure-dev (10)
- # clojure-europe (1)
- # clojure-greece (1)
- # clojure-italy (5)
- # clojure-nl (15)
- # clojure-spec (33)
- # clojure-switzerland (1)
- # clojure-uk (10)
- # clojurescript (121)
- # clojutre (3)
- # code-reviews (2)
- # core-async (1)
- # cursive (10)
- # data-science (1)
- # datomic (21)
- # emacs (10)
- # events (1)
- # fulcro (25)
- # graphql (6)
- # joker (4)
- # kaocha (12)
- # lambdaisland (3)
- # music (2)
- # off-topic (112)
- # om (2)
- # re-frame (25)
- # reagent (29)
- # reitit (93)
- # rewrite-clj (2)
- # shadow-cljs (18)
- # slack-help (4)
- # spacemacs (8)
- # tools-deps (1)
- # vim (2)
- # yada (5)
Great! That's working for the maps, I should be trying to port the aws-amplify withAuthentication hoc soon. Thanks!
Any chance that some one succeeded on running F3 on RN or with expo? an example on how to mount the app and register the root component would much appreciated, I wasn't able to
@sifou I don’t do any react native. It is likely we’ll have to do a patch or two. Look in application.cljc…the render stuff is all pluggable.
and you’ll definitely need to set the application options for :render-root!
and :optimized-render!
@bbss Should be similar…but don’t follow their advice and wrap Root…Root is special in Fulcro, but you should be able to make a component just under root and use the pattern there.
I'm not sure if I'm doing something wrong, but since my router seems to work fine if I manually specify a ::dr/id
for the router in the initial state of the root component I thought I'd mention. If I don't do that it causes route-deferred to never succeed as it can't find a router id when the target-ready is called.
@bbss likely something you’re doing wrong…using DR in a number of places/projects…though admittedly not deferred routing much
@bbss make sure you understand initial state. You do have to compose the initial state of the routers to root, just like anything else that appears in the app at startup.
Also, remember that initial state is initial state…it is the “first frame” of rendering. The legacy union router does go through and use the initial state from all branches, but the dynamic router does not (because it gives you a mechanism to set up state on entry). Nested routers could require a bit more work to get into app state correctly.
That is an area of D.R. that I’d be willing to expand (if we can come up with a proposal for what should be done).
I don't have all my data compose to root, does the router expect initial state to match the query? I usually guard in my component (and now in the will-enter) with filler data or so.
If you make an initial state as a lambda, you should typically call get-initial-state
on the child, not manually enter it.
:initial-state {:root/router {}}
;; MEANS
:initial-state (fn [_] {:root/router (get-initial-state RootRouter {})})
Yes, I think that was it, using get-initial-state
in the lambda seems to work as well 🙂. I think I'll keep that in mind, might have been bitten by not using get-initial-state
before.
it’s not meta-data…it’s the actual data that was declared on the target component as initial state
defsc
supports a non-lamba shorthand that rewrites it to eliminate boilerplate, as shown above
@bbss also, if you are looking for a solution to augment
data at component level (not just at first frame, but also as response to load
or merge-component
) you should check :pre-merge