Fork me on GitHub
#fulcro
<
2018-09-02
>
hjrnunes13:09:34

@tony.kay thanks. But it seems I can't make anything work in that style. e.g.

(defcard dropdown
  (dom/div
    (f/ui-dropdown {:text "A Dropdown"}
                   (f/ui-dropdown-menu
                     (f/ui-dropdown-header {:content "header"})))))
Shows nothing but the "A Dropdown" text. Dropdown is empty. It works if I pass the correspondent props to ui-dropdown Other stuff seems to work though.
(f/ui-button-group nil
                       (f/ui-button nil "A")
                       (f/ui-button nil "B")
                       (f/ui-button nil "C"))
Works fine. Maybe there's something wrong with the factory or something? Where should I look? I don't have much experience with CLJS

eoliphant13:09:33

Hi. I'm playing around with the CSS support, and it seems like i have to do a page refresh in order to have some component's updated CSS to be output by `injection/style-element' is there any way around this for dev?

tony.kay18:09:36

@eoliphant I thought that was in the docs (or docstring)...I think I made it so you can change the react key?

4
tony.kay18:09:59

Yeah, it's in the docstring...add a :react-key that you change during dev

tony.kay19:09:58

@hjrnunes I agree with you: that particular structure does not work for me either...though you do need props on every level (but even that doesn't seem to fix it for me). All that said, the wrappers library was a good intention on my part, but to be honest now that shadow-cljs exists, I really don't have any desire to have/maintain such a set of wrappers. It's better to just directly use them from npm via shadow-cljs instead.

tony.kay19:09:07

Here's what it would look like with just using shadow-cljs:

(ns your-app
  (:require
    [fulcro.client.dom :as dom]
    ["semantic-ui-react" :refer [Dropdown DropdownItem DropdownMenu]]))

(defn ui-dropdown [& args] (dom/macro-create-element Dropdown args))
(defn ui-dropdown-menu [& args] (dom/macro-create-element DropdownMenu args))
(defn ui-dropdown-item [& args] (dom/macro-create-element DropdownItem args))

(ui-dropdown {:text "Filter"}
      (ui-dropdown-menu {}
        (ui-dropdown-item {} "A")
        (ui-dropdown-item {} "B")))
I've verified that that works fine.

tony.kay19:09:05

use the shadow-cljs option on lein new fulcro app shadow-cljs, then do an npm install semantic-ui-react --save

hjrnunes20:09:42

@tony.kay thanks! Yeah, I went with figwheel by default. I've been wondering whether I should switch. That settles it then.