Fork me on GitHub
#reagent
<
2020-03-28
>
Pavel Klavík02:03:15

Hi, I was implement a workaround for Material-ui TextField described here: https://github.com/reagent-project/reagent/blob/master/examples/material-ui/src/example/core.cljs#L39, and I am curious why create-element + convert-props-value is used instead of adapt-react-class. I wrap it as

[:> TextField {...}]
and everything seems to work fine.

juhoteperi12:03:30

@pavel.klavik Might have been because apply works nicely for handling variable number of children. :> and adapt-react-class also do automatic conversion of props from Cljs -> JS which often can work incorrectly, but doesn't seem to affect this as this calls the same convert function.

juhoteperi12:03:03

I've added new example project for React Context and the docs now link to this: https://github.com/reagent-project/reagent/blob/master/examples/react-context/src/example/core.cljs this describes the difference for properties conversion

👍 4