Fork me on GitHub
#reagent
<
2019-09-04
>
ag00:09:32

hey friends, question here… React.setState() | React.useEffect() are not compatible with Reagent, right?

ag00:09:06

will they ever be?

ag00:09:40

the reason I’m asking - it’s not because I want to write code with hooks, reagent/re-frame have better tools for that, I’m asking because I found myself in a corner where I cannot re-use third-party React libs with hooks

David Pham06:09:45

Look at the react features document on the repository.

ag17:09:52

Oh, that’s exactly what I needed. Thanks a lot!

ag18:09:27

in that example https://github.com/reagent-project/reagent/blob/363f2d4976ac077a289d7a5d46d41a22e15d723c/doc/ReactFeatures.md#hooks how do I send parameters into example component fn? [:> example args] doesn’t seem to be working

eskemojoe00720:09:06

Question about passing a component as a property. When using material-ui there are a couple of forms that require that you pass an element as a property (from their example):

<Select
          value={values.age}
          onChange={handleChange}
          input={<FilledInput name="age" id="filled-age-simple" />}
        >
Documentation confirms that input takes an element. I tried the following with no luck:
[:> mui/Select
        {:input [:> mui/FilledInput {:id "country"
                                     :name "country"}]]
Got an clues?

stefan20:09:12

The reagent.core/as-element function creates a React element from a Hiccup form http://reagent-project.github.io/docs/master/InteropWithReact.html

👍 4
David Pham20:09:17

And there is also an example only for material-ui, (the text component is tricky)

eskemojoe00721:09:36

Yeah...I followed that, but am messing with selects.

eskemojoe00721:09:11

worked great, but material-ui with reagent is not simple at all with all the wonky stylings and other refs and states floating around.

David Pham21:09:54

No clearly not.

David Pham21:09:11

It is not “easy”.