Fork me on GitHub
#reagent
<
2020-10-28
>
Nathan09:10:01

Hello, I'm using an UI library from NPM that provides a PageHeader component which accepts a prop called extra which is an array of components that can be added to it. For example:

<PageHeader  
      title="Title"
      extra={[
        <div>first</div>,
        <div>second</div>
      ]}
    />
I'm trying to use this prop with Reagent like this:
[:> PageHeader {:title "title"
                  :extra [[:div "first"]
                          [:div "second"]]
                  }]
but the components are printed out as strings in the DOM (ss in the thread). I don't know how Reagent interprets this form of components being passed as props or what I'm missing here. Can anybody help me? Thanks!

Nathan09:10:10

This is the result in the DOM

p-himik09:10:06

Wrap the Hiccup vectors in reagent.core/as-element.

Nathan10:10:42

It works. Thanks!

kah0ona11:10:47

Hi folks, It seems for some reason reagent can’t find react anymore, and I get these kind of messages:

Uncaught TypeError: $reagent$impl$component$$.$node$module$react$ is undefined

kah0ona11:10:31

how to debug this. With figwheel locally it works, also the compiled minified bundle (with :psueod-names true) shows that React / ReactDOM are in there

kah0ona11:10:50

Any pointers in how to debug this?

David Pham18:10:55

Did you import react somehow?

Lone Ranger19:10:23

@kah0ona it's a version conflict, almost certainly

Lone Ranger19:10:29

just ran into this recently