Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tkriplean opened this issue Sep 10, 2014 · 4 comments

Comments

@tkriplean
Copy link
Member

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.

@tkriplean tkriplean changed the title ComponentDidMount not triggered if component fails to render due to missing activerest data ComponentDidMount never called if component fails to render due to missing activerest data Sep 10, 2014
@toomim
Copy link
Member

toomim commented Sep 10, 2014

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
Copy link
Member Author

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
#11 (comment).

@toomim
Copy link
Member

toomim commented Sep 10, 2014

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

@toomim
Copy link
Member

toomim commented Jun 15, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants