This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
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 😕
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
@rhansen: sounds unlikely, but it could be a bug - would want to see a minimal case though as it hasn’t been reported before.
@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.
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.
@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
@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)
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.