It has been a very long time since I looked at recursion in the context of unions (which I almost never use). I’m not sure if I ever planned to support the specific use-case you’re trying (honestly have no memory…4-5 yrs ago). We have pretty solid tests for db->tree, so you’re welcome to take a shot at implementing it.
See the composition cards in the fulcro-3.5 branch ( in progress). Those will be the more ideal items.
not released, but relatively stable, so you use a SHA/git via deps
I’ve actually been talking about these on this channel for the past few weeks.
Is the autocomplete used in the demo? I thought I used everything that was supported in the demo. Perhaps you are using the options incorrectly. I don’t remember off the top of my head, which is why I tried to use everything in the demo…could be I overlooked that one, but I know I’ve used autocomplete at some point.
I'd do this
(defsc Photo [this {:ui/keys [photo] :as props}]
{:ident (fn [] [:component/id ::Photo])
:query [:ui/photo]
:initial-state {:ui/photo :params/photo}
:route-segment ["photo"]}
(log/debug "Photo props" props)
(if photo
(n/ui-view {:style {:flex 1}}
(n/ui-text {} "Hello there!!!!!!")
(n/ui-image {:source {:uri photo}})
(rne/ui-button {:title "Accept"
:buttonStyle {:height 40}
:onPress (fn [] (js/alert "You pressed the button!"))}))
(do
(-> (.requestMediaLibraryPermissionsAsync ImagePicker)
(.then (fn [resp]
(when (.-granted resp)
(.launchImageLibraryAsync ImagePicker))))
(.then (fn [resp]
(when (and resp (not (.-cancelled resp)))
(m/set-string! this :ui/photo (.-uri resp))))))
(dom/p "..."))))
I've found some problems with the hooks/use-component
function in the fulcro-3.5 branch.
Firstly, the initialize?
option is given the default binding of true
with associative destructuring, but this binding is never used. Instead, the original options
map is passed directly to rapp/add-component!
, so initialisation of state does not happen by default. I assume it is actually meant to be true
by default either in use-component
or add-component!
.
Secondly, the initial-params
option is completely ignored for the first comp/get-initial-state
call because (or {} initial-params)
always evaluates to {}
. I believe the or
should be omitted, since a default binding has already been specified.