This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-15
Channels
- # adventofcode (121)
- # bangalore-clj (5)
- # beginners (46)
- # boot-dev (9)
- # cider (20)
- # cljs-dev (7)
- # cljsrn (1)
- # clojure (341)
- # clojure-austin (7)
- # clojure-greece (144)
- # clojure-india (3)
- # clojure-italy (5)
- # clojure-spain (1)
- # clojure-spec (34)
- # clojure-sweden (3)
- # clojure-uk (90)
- # clojurescript (24)
- # core-async (1)
- # core-logic (7)
- # cursive (108)
- # datascript (2)
- # datomic (39)
- # events (1)
- # fulcro (225)
- # graphql (8)
- # hoplon (86)
- # instaparse (12)
- # jobs-discuss (2)
- # jvm (4)
- # keechma (1)
- # lein-figwheel (2)
- # leiningen (12)
- # off-topic (26)
- # onyx (35)
- # other-languages (1)
- # pedestal (3)
- # planck (11)
- # re-frame (12)
- # reagent (12)
- # reitit (5)
- # spacemacs (48)
- # specter (29)
- # sql (2)
- # test-check (1)
- # unrepl (71)
Hey. This feels like one of those questions that should have a quick answer: how do we sanitise HTML against XSS when using {:dangerouslySetInnerHTML {:__html ... }}
? I see that DOMPurify is the answer in regular React world, but it's not in cljsjs
@shen Or most likely, no one has needed it, so it is not packaged
is it possible to throttle re-rendering of children? e.g. I have a component which receives a width from the parent component, but when a CSS animation is running it receives it often, which makes the animation very slow because of the re-renders
so I want to throttle the propagation of the width to the children by let’s say 0.2s of something
You could do something like create a buffered-width
and set the child width based on that. Then you could for example track the last time buffered-width
was updated. When a new parent width comes in, if less than 0.2s has gone by, ignore it, otherwise update it. Since the value of buffered-width
isn’t changing, it won’t redraw the child width
You’d probably want to add a setTimeout
in there somewhere to make sure you don’t end up losing the last width change or 3.