This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-12
Channels
- # aleph (8)
- # announcements (9)
- # babashka (15)
- # beginners (91)
- # calva (54)
- # chlorine-clover (3)
- # cider (25)
- # clj-kondo (9)
- # cljfx (4)
- # cljsrn (12)
- # clojure (40)
- # clojure-australia (2)
- # clojure-europe (77)
- # clojure-nl (10)
- # clojure-spec (22)
- # clojure-uk (9)
- # clojurescript (39)
- # conjure (12)
- # cursive (8)
- # datascript (17)
- # datomic (22)
- # emacs (2)
- # expound (6)
- # fulcro (25)
- # kaocha (7)
- # malli (9)
- # meander (5)
- # off-topic (13)
- # pathom (8)
- # pedestal (5)
- # portal (1)
- # rdf (58)
- # re-frame (65)
- # reagent (15)
- # sci (3)
- # shadow-cljs (50)
- # test-check (6)
- # testing (3)
- # tools-deps (1)
- # vim (7)
- # xtdb (10)
Any idea why this would work fine:
[:button {:on-click #(save-form acct)} "Save"]
while this would generate a react error:
[:input {:type "button"} "Save"]
of the type:
' input is a void element tag and must neither have children
nor use dangerouslySetInnerHTML
.'
You want to either make “Save” into a placeholder attribute on the input, or else add a label
element to contain the “Save” text.
ok, thanks!
That depends on what you want “Save” to function as. If you set value
to be “Save,” then it will change if you edit the text in the input, but if you want “Save” to function as a label when the input is empty, then you want to assign it to the placeholder
attribute.
What text in what input? <input type="button">
will be rendered as a button, there's nothing editable there.
Oh, true, I was thinking of text inputs.
Skimmed right over the {:type "button"}
bit, derp