Fork me on GitHub

For this code,

what is :> in (defn root []
  [:> rn/View {:style (:container styles)}


Thanks. Is there a quick way to see the translated output of cljs to some vanilla js like what does ?


No, because there's no translation step.


What exactly are you trying to figure out?


Currently no. The link solves the actual question.

Greg Jeanmart14:03:21

Hello, I'm trying to use but I have to admit I have no clue how to handle this kind of React syntax (function in component) with reagent. Any tips?

const ref = React.createRef();
    <ReactToPdf targetRef={ref} filename="div-blue.pdf">
        {({toPdf}) => (
            <button onClick={toPdf}>Generate pdf</button>
    <div style={{width: 500, height: 500, background: 'blue'}} ref={ref}/>


The post above yours has the two doc links in its thread. :)

Greg Jeanmart14:03:00

haaaa thanks. Next time I will scroll up a bit !


Or better yet, just read the titles and subtitles in the Reagent documentation files. :) 99% of the time the answer is there.

👍 3
Ronny Li22:03:19

Hi everyone, my components are starting to have a lot of control flow code inside. Any suggestions for the best practice to split things up? Example:

(defn my-component [args hidden? collapsed? suppress-error-msg?]
Thank you 🙂


Check out how re-com is implemented. One note on that though - personally, I would advise against using [& {:keys [...]}] in favor of using [{:keys [...]}].

Ronny Li22:03:46

Thank you! I'll take a look


one thing to consider is breaking up your component into separate components that a consumer can get more control from:

(defn some-component []
  (let [collapsed? (r/atom false)]
    (fn []
      [collapsable {:collapsed? @collapsed}
       [my-component-body ,,,]])))