invisible-college / statebus

All aboard the STATEBUS!!!
117 stars 5 forks source link

ComponentDidMount never called if component fails to render due to missing activerest data #11

Open tkriplean opened 10 years ago

tkriplean commented 10 years ago

ActiveREST catches errors that occur when a component is rendered that depends on data that is not yet available. It will then rerender that component when the data becomes available.

One problem with the current implementation is that ComponentDidMount will not be executed for any component that is rendered before its data is available. The first time, the render fails and ComponentDidMount isn't called; when activeREST rerenders the component after the data is available, ComponentDidUpdate is called instead.

This is pretty easy to workaround if you know it is happening. But it can be difficult to diagnose.

I recognize that ideally we wouldn't need to use ComponentDidMount events.

toomim commented 10 years ago

Hm. I can't see why componentDidMount is not being called. When render throws an error, the wrapper catches the error and returns a loading indicator. Then react should proceed to do a componentDidMount as usual.

I guess I can write up a test case for this in testmike.coffee to try to reproduce it and see what's happening.

tkriplean commented 10 years ago

Once I get this latest considerit code committed, I can show you a case of it. I don't think this is a terribly important bug.

toomim wrote:

Hm. I can't see why componentDidMount is not being called. When render throws an error, the wrapper catches the error and returns a loading indicator.

I guess I can write up a test case for this in testmike.coffee to try to reproduce it and see what's happening.

— Reply to this email directly or view it on GitHub https://github.com/TheInvisibles/Nervous/issues/11#issuecomment-55070411.

toomim commented 10 years ago

Yeah we don't need to focus on it now. Thanks.

toomim commented 7 years ago

This might be causing problems @morgandixon was seeing in cheeseburger with .up not being called in the new statebus.