Fork me on GitHub
#om
<
2015-12-26
>
rhansen13:12:21

This is strange. Has anyone experienced that (om/get-props this) returns an empty props object, even when you explicitly pass props? In my debugger, I can see that the props object on the component is set, yet get-props returns an empty object 😕

rhansen13:12:26

I’m assuming I’m doing something very wrong. But the parent component passes on the correct props, yet the child component (even though I can see in the debugger that the props object is set on the component) cannot seem to read props :S

dnolen13:12:04

@rhansen: sounds unlikely, but it could be a bug - would want to see a minimal case though as it hasn’t been reported before.

not-much-io13:12:01

@rhasen I noticed that when trying to println props, it was nil for some reason, when it should not have been. However I am not at a computer and cannot give any more input, left before I got it sorted out. Though I'd be more inclined to belive I did something wrong, regarding passing props or queries.

not-much-io13:12:57

@rhasen also nil is different from an empty object.. unrelated most likely.

rhansen13:12:51

Hmm… I’m going to poke around some more. I’m sure I’m doing something funky, otherwise more people would be having this problem. Will try to recreate in a minimal case if I cannot figure out what is going on.

jetmind13:12:24

@rhansen: are you using om.next components? Maybe try using (om/props this) instead of om/get-props and see if it helps https://github.com/omcljs/om/wiki/Documentation-%28om.next%29#props

anmonteiro13:12:44

@rhansen: not sure what your use case is, but get-props is private and I suppose it shouldn't be used (https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L351)

rhansen13:12:18

@jetmind, @anmonteiro: That is probably it. Thanks. Every time I ask a question in this channel I walk away slightly embarrassed 😛

rhansen13:12:16

I was using get-state in the same render-fn, and get-props seemed appropriate, especially since I didn’t get a warning from figwheel that it was a private fn.

jetmind13:12:08

Same here :)

maackle16:12:50

That naming can be quite confusing (`om/get-state`, om/get-computed, but not om/get-props)