Skip to content

Conversation

xzyfer
Copy link
Contributor

@xzyfer xzyfer commented Oct 10, 2017

Whenever an error occurs resolving a component this.state.error = true,
however handling the error happens too late. As a result in an environment
where typeof window !== 'undefined' i.e. the browser, this results in an
infinite render loop.

This PR hoists the error handling earlier in the render call.

Fixes #42

Whenever an error occurs resolving a component `this.state.error = true`,
however handling the error happens too late. As a result in an environment
where `typeof window !== 'undefined'` i.e. the browser, this results in an
infinite `render` loop.

This PR hoists the error handling earlier in the `render` call.

Fixes ctrlplusb#42
@ctrlplusb
Copy link
Owner

Really excellent stuff here @xzyfer! Thanks so much for this.

I am gonna try pull it down and have a play but so far it LGTM.

❤️

@jfsiii
Copy link

jfsiii commented Oct 10, 2017

Confirming that this work for me

@ctrlplusb ctrlplusb merged commit 3216f71 into ctrlplusb:master Oct 11, 2017
@xzyfer xzyfer deleted the infinite-loop branch October 11, 2017 23:49
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

Successfully merging this pull request may close these issues.

3 participants