Fork me on GitHub
#reagent
<
2016-11-28
>
andre12:11:55

hi . how can i stop rendering?

andre12:11:09

can i use unmount-component-at-node ?

pesterhazy16:11:28

🎶 never stop ... rendering 🎶

pesterhazy16:11:25

Does anyone know what's the cause of this react warning (with reagent):

react.inc.js:20541 Warning: ReagentInput is changing an uncontrolled input of type undefined to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. 

gryffindorstudent16:11:38

@pesterhazy Perhaps unrelated to the problem but why is the input type undefined?

pesterhazy16:11:17

hah good catch... didn't even see that

juhoteperi16:11:58

"Uncontrolled input" means that the input doesn't have value

pesterhazy16:11:25

right... I'm trying to figure out which input that could be

pesterhazy16:11:46

it's because my input didn't have a :on-change handler

pesterhazy16:11:12

(because it's {:read-only "readOnly"}

pesterhazy16:11:24

curious, curious 🙂

pesterhazy16:11:31

@madvas thanks for packaging react-datetime for cljsjs, super easy to integrate

pesterhazy16:11:55

I had no idea that packaging an npm module could be so simple

mikethompson20:11:39

@pesterhazy where do I look for react-datetime ... can't seem to find it

eoliphant20:11:43

Hi, I’m new to the whole ecosystem. have gotten a good grasp of reagent, etc on it’s own. Trying to better understand pulling in React libs as most of the examples I see are using say Reagent to build components

eoliphant20:11:54

[cljsjs/react-datetime "2.6.0-0"]

eoliphant21:11:08

is what I found poking around in cljsjs

eoliphant21:11:27

but I’m not sure how to say use react-datetime, once I’ve imported it. Is the component already ‘required’ on the JS side so I just do something like (… js/Datetime ..) in my cljs code?

eoliphant21:11:40

yeah i was looking at that one as a simple exmple of trying to figure this out lol

eoliphant21:11:42

Ok, that, with ‘pure’ JS I have kind of managed to get my head around

eoliphant21:11:07

i’m not clear on say pulling in another React component and using that in Reagent

gadfly36121:11:25

gotcha, yeah then I am not sure. My guess would be what you said tho, using js/ and then using adapt-react-class to make it usable within reagent

eoliphant21:11:02

I saw this, but this is more hacking than I’d like to do at this point lol.

(defn home-page []
  (let [react-player (aget js/window "deps" "react-player")]
    [:div
     [:h2 "Zef Style"]
     [:> react-player {:url ""}]]))
http://blob.tomerweller.com/reagent-import-react-components-from-npm

eoliphant21:11:18

Ok, just looked up ‘adapt-react-class’ that seems more or less like what i’m looking for, I’ll play with that.

tomerweller21:11:09

Hey @eoliphant, I wrote that blog post and it definitely is a bit hackish 🙂 though I have yet to find a better solution

tomerweller21:11:44

Cljsjs is cool, just make sure the package you’re using is up to date. (they are often not)

eoliphant21:11:49

lol 😉 well it looks like it works fine, it was more on my side. I’m already ‘sipping from the firehose’ so I was just trying to keep my moving parts down at the moment lol

eoliphant21:11:06

i’m interested in say using the React version of Semantic UI, etc

eoliphant21:11:17

so will probably need to do that ay some point

eoliphant21:11:02

or wrapping it lol, work either way

tomerweller21:11:04

good luck with that. It’s just a bunch of moving parts but nothing too complex

eoliphant21:11:51

yeah, another thing i’m I think realizing is that say Reagent, Om etc are almost like their own frameworks that use React for plumbing, so hence the need to ‘adapt-react-class’ etc in order to make React components more ‘Reagenty’

eoliphant21:11:09

yeah and to your point, for instance what’s on cljsjs for semantic ui is the jquery js, not the react version

pesterhazy22:11:25

(adapt-reagent-class js/Datetime) works in the way you'd expect