om

Please ask the channel first, not @dnolen directly!
2017-03-24T07:42:23.573139Z

I'm trying to use :shared-fn to share the current user across all components. Problem is, it isn't updated on login/logout without a refresh. Is there a way to 'refresh' the reconciler?

2017-03-24T08:54:50.295920Z

Login and logout are the only times when this is a problem, but i'd rather not trigger a page reload if I can avoid it.

2017-03-24T09:10:39.495562Z

Doesn't seem to work 😞 I'm trying to call it in componentDidUpdate of my Wrapper component if the user props change..

2017-03-24T09:14:36.544757Z

It does go through my :shared-fn.

2017-03-24T16:07:44.415202Z

It seems like force-root-render! does not force re-rendering every component, it still diffs the props. This seemed to be the problem earlier ^^, I was looking for a method of refreshing the entire UI tree.

tony.kay 2017-03-24T17:04:56.683600Z

It is alraedy built-in

tony.kay 2017-03-24T17:05:06.687723Z

that is what :ui/react-key on the root is for

tony.kay 2017-03-24T17:05:22.693548Z

you have to change the key on the root element, or React won't really re-render everything

tony.kay 2017-03-24T17:05:29.695991Z

@danielstockton

tony.kay 2017-03-24T17:05:54.704743Z

oh, sorry, that comment was an untangled-ism, but the fact is true for React in general

tony.kay 2017-03-24T17:06:39.721170Z

If the React key changes on an element, then React doesn't even look at diffs: it just re-renders the whole UI (sub)tree

tony.kay 2017-03-24T17:07:22.736881Z

For your use-case, you might want to use a link query instead of shared

tony.kay 2017-03-24T17:07:40.743115Z

cause that way you could trigger re-renders on components that ask for that "root" data

tony.kay 2017-03-24T17:07:47.745587Z

through the normal Om mechanisms