I'm not all that familiar with how React works, but I've been using Om extensively since March, so my understanding is based on the use of Om, browsing its code and only on reading the React material in small pieces. I've also looked at owner in the chrome inspector many times.
Om docs describe owner as the "react backing object" and that link describes it as the owner of the components below it. The way I read it is that owner is the React object which "owns" the local state, lifecycle functions and child components of the component that your component function is creating. That is, its not the parent of your component, it IS your component and it is what React uses directly. Re: props, what React calls props, Om replaces with its cursors. Internally Om uses props to manage the cursors, but you don't really need to worry about that and use the cursors instead. The name props does occasionally leak through Oms abstractions, for example in the will-receive-props, will-update and get-update lifecycle functions and the get-props function, however what these call "props" is actually the components app-state as pointed to by the cursor (or perhaps the cursor itself, you'd have to double-check as I don't recall OTOH. I think it may be function specific: get-props most likely returns the cursor, did-update probably doesn't). Hope that helps! On 17 August 2014 09:43, Mark Engelberg <[email protected]> wrote: > On Saturday, August 16, 2014 10:02:18 PM UTC-7, Jonas Enlund wrote: > > Hi > > > > 'owner' is the underlying React component. Ownership means something > specific in React, you can read about it here: > http://facebook.github.io/react/docs/multiple-components.html#ownership > > > > /Jonas > > I looked at that, and didn't find it particularly illuminating: > > "In React, an owner is the component that sets the props of other > components. More formally, if a component X is created in component Y's > render() method, it is said that X is owned by Y." > > There are two sentences here. The first one refers to "props". Props > aren't mentioned anywhere in the Om tutorial, nor in any of the Om wiki > documents about underlying concepts. It's not even clear to me if props > has anything to do with Om, maybe this was one of the concepts that doesn't > translate from react to Om? > > Second sentence says basically that the owner is whichever component > created this one. That is slightly more helpful -- this sentence implies > that an owner is simply another component. But it looks from the examples > in the tutorial that this is false; the owner is not in fact a component > (where component is defined to be one of the reified objects that supports > the various lifecycle protocols). It appears that owner is not a > component, but something that tracks state and dom location and possibly > other things as well. So what kind of object is an owner, and what does it > track? > > -- > Note that posts from new members are moderated - please be patient with > your first post. > --- > You received this message because you are subscribed to the Google Groups > "ClojureScript" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/clojurescript. > -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
