Fork me on GitHub
#reagent
<
2016-06-07
>
rui.yang03:06:55

hi, is it possible to pass a component as a parameter to another component? the idea is to have main template, and everytime route change, you just need to change the content area

rui.yang03:06:50

like [main-template child-view], child-view could be a form-2 component, like returning a function of rendering hiccups.

mikethompson03:06:11

@escherize: I'm not seeing the gist get loaded (Chrome, Windows)

escherize03:06:26

You may need to click the textarea 😊

rui.yang07:06:13

@escherize if child component is form 2 component, returning a rendering fn, will it work?

rui.yang07:06:33

yes, very close. can child accept parameter? sorry, on the way home and no access to my laptop to try it myself

dilin18:06:31

can someone help me with an atom issue? trying to clear a text input in an ajax callback, but the input element’s value stays the same, even after i clear the atom it reads the value from. i can post some code to clarify if needed

gadfly36118:06:10

Yeah, please post code :)

dilin18:06:00

i checked to make sure the value of the atom is correct both before and after it is reset (in the :handler of the ajax call)

dilin18:06:37

it seems like the input element isn’t being re-rendered after the handler updates the atom

gadfly36118:06:08

Not near a computer, but I don't see anything wrong at first glance... Hopefully someone else can spot the issue! (I never use reset and always use swap on an atom and a hash-map. Can't imagine why that'd make a difference tho.)

mihaelkonjevic18:06:02

@dilin should it be :val or :value ?

dilin18:06:15

changing it to :value fixed it, thanks!

gadfly36118:06:56

Good eye! :)

jcromartie20:06:03

what is the relationship between arguments to a Reagent component and React props?

jcromartie20:06:00

If I say (defn some-reagent-component [props]) and pass it a map, do those get turned into real React props?

jcromartie20:06:29

or if I say (defn some-reagent-component [x y z]) do those arguments get stored as props at all?

jcromartie20:06:31

the source is great

tom21:06:57

What's the best way to export and use a component in JSX written with create-class?