This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-02
Channels
- # announcements (3)
- # asami (29)
- # babashka (62)
- # beginners (131)
- # biff (7)
- # calva (31)
- # cider (5)
- # clerk (14)
- # clj-kondo (3)
- # cljsrn (12)
- # clojars (18)
- # clojure (72)
- # clojure-austin (17)
- # clojure-dev (6)
- # clojure-europe (31)
- # clojure-indonesia (1)
- # clojure-nl (1)
- # clojure-norway (18)
- # clojure-sweden (11)
- # clojure-uk (6)
- # clr (47)
- # conjure (42)
- # cursive (88)
- # datalevin (2)
- # datomic (25)
- # emacs (42)
- # exercism (1)
- # fulcro (10)
- # funcool (8)
- # gratitude (2)
- # honeysql (16)
- # introduce-yourself (5)
- # jobs-discuss (26)
- # leiningen (5)
- # lsp (31)
- # malli (21)
- # matcher-combinators (14)
- # missionary (2)
- # nbb (1)
- # off-topic (40)
- # pathom (38)
- # portal (2)
- # re-frame (7)
- # reagent (18)
- # reitit (1)
- # releases (5)
- # shadow-cljs (62)
- # sql (12)
- # testing (4)
- # xtdb (37)
Hello fellas, how do I get the react component alternative of dom elements for example (from Mantine's documentation):
function Demo() {
return <NavLink component="a" href="/home" target="_blank" />;
}
how would I pass the a
element to my comp/react-factory
wrapper of the NavLink
component?(ui-nav-link {:component "a" :href...}) of it's just a string
I’m not sure I understand the question, and perhaps Jakub did and is right. The dom/a
in Fulcro is both a macro and a function, so you can always pass it by value. You can also use a string and then use that string (“a”) as the tag in c.f.f.dom/crete-element
You can also pass an element (reified) from react (e.g. (dom/a {:href "foo"})
returns an element value that can be used elsewhere). i.e.
(let [ele (dom/a ...)]
a)
is legalAlso what ui libraries have you found easy to work with from within fulcro other than semantic/fomantic
Any react component/library that honors the “controlled component” idea is best. Anything works ok once you understand how to put a factory on it, but since Fulcro encourages you to control state, controlled components are best. That said, input-like things may need a patch (see StringBufferedInput in c.f.f.dom.inputs)
Usually the hardest part is js ecosystem variances…i.e. how do you actually require
the darn thing, and how do you deal with things like “embedded css” that webpack is supposed to handle. Those are not Fulcro issues.
thank you, I was trying to solve this exact problem earlier when porting the fulcro template to pathom3
Thanks that's good to hear :)