This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-02-18
Channels
- # boot (42)
- # cider (26)
- # cljs-dev (6)
- # cljsrn (6)
- # clojure (119)
- # clojure-berlin (3)
- # clojure-dev (2)
- # clojure-nl (1)
- # clojure-russia (38)
- # clojure-spec (1)
- # clojurescript (44)
- # component (3)
- # cursive (1)
- # data-science (2)
- # datomic (19)
- # dirac (60)
- # emacs (12)
- # figwheel (2)
- # hoplon (13)
- # iot (4)
- # keechma (2)
- # klipse (38)
- # leiningen (5)
- # luminus (1)
- # lumo (1)
- # off-topic (6)
- # om (2)
- # om-next (4)
- # onyx (21)
- # perun (79)
- # reagent (32)
- # untangled (39)
- # vim (36)
- # yada (1)
Very welcome!
I have a big (npm/react/jsx) project. Is there any migration plan to use npm/jsx mixed with reagent?
Hi, is there a way to set custom attributes for tags? I know I can just use arbitrary map key to do that, but React has a whitelist to pass/ignore attributes. However .. it's possible to use the is
attribute to disable the whitelist. That would be great if I could set an attribute which has no value in reagent. Anyone has an idea to overcome this? I need a custom attribute to be set on electron webview element.
hm you can use data-sadf
etc. attributes, can't you?
No, because I need to set disablewebsecurity
attribute which has no value and is not in the whitelist
If I there would be a way to set an attribute without value - I could set disablewebsecurity
and is
which disables the whitelist
you could use dangerouslySetInnerHTML ?
I haven't heard about is
, is this documented?
I'm not sure it's documented, but it works (I did it in js)
dangerouslySetInnerHTML and other non-elegant ways should work, but I'm wondering if maybe there is a simpler way
what does is
do?
It allows to set any attribute on the tag, and it won't be whitelisted by react
by the way, why does react even check attributes?
do you know?
No idea
It is documented: http://reactjs.cn/react/docs/jsx-gotchas.html > However, arbitrary attributes are supported on custom elements (those with a hyphen in the tag name or an is="..." attribute).
hm it's mentioned but not really explained
but maybe that's just JSX?
check out what React Element gets generated
It worked in reagent though, I now checked {:is true :disablewebsecurity true}
and disablewebsecurity
landed in dom
ah nice
problem solved?
although the docs mentioned is
should be a string?
@pesterhazy Maybe the docs are inaccurate. Looks like it works. Thanks for help 🙂
your interpretation in borne out by this anwer: http://stackoverflow.com/a/33860892
is
is a weird attribute name to pick
I'm just a poor api consuemer 🙂
I guess the code just checks the key and ignores the value.
the attribute checking is weirdly paternalistic
but whatever 🙂