hello, I'm trying to use a third party UI library with Reagent, not sure I fully understand when to use :>
(defn hello-component []
[:> cui/Button {:variantColor "green"} "Button"])
this one doesnt work
but this one:
(defn hello-component []
[:cui/Button {:variantColor "green"} "Button"])
works
but it won't take the props
What "doesn't work" mean?
I get the following
TypeError: right-hand side of 'in' should be an object, got undefined
The above error occurred in the <Button> component:
in Button (created by devcards.main.hello_component)
in devcards.main.hello_component
in devcards.main.hello_component (created by DevcardBase)
in div (created by DevcardBase)
in div (created by DevcardBase)
in div (created by DevcardBase)
in DevcardBase (created by DevcardsRoot)
in div (created by DevcardsRoot)
in div (created by DevcardsRoot)
in div (created by DevcardsRoot)
in div (created by DevcardsRoot)
in DevcardsRoot
undefined
sounds like you didn't provide some required properties.
so overall it should be working with the :>
?
Yes.
okay. it's probably something else because the button component has no required props.
Maybe Reagent is not so tolerant to third-parties React elements?
It should work just fine.
What is cui/Button
?
(:require [reagent.core :as r]
[devcards.core :as dv]
["@chakra-ui/core" :as cui])
this is how I require it
I see. Have you followed through https://chakra-ui.com/getting-started ?
Yes I have. the there provider is optional
I mean, I can use it in js env with no problems
okay you are correct
something is off
the ThemeProvider is not optional as they say in their docs
Yep. :)
Wow thank you for your time man
I truly appreciate it