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

Allow supplying an error catcher component #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

glenjamin
Copy link

This is the first cut for error catching facilities in react-proxy.

This works on classic and class components, without breaking any existing tests.

Because the error component is optional, most of the tested code paths don't actually touch the new code. I wasn't sure how many tests to expand to cover this, so I figured I'd show what I have so far.

As this is a nice incremental change, I think it's useful to aim to merge this without pure component support initially - that might require more invasion changes.

For pure components, I think that https://github.com/gaearon/react-proxy/blob/c019762362a4936ed86d6bb89ad6a57e13de6c06/src/createClassProxy.js#L65-67 might have to change to use detection (like with

if (InitialComponent.prototype && InitialComponent.prototype.isReactComponent) {
) instead of a fallback.

One thing I did wonder about just now - what happens if you attempt to replace a component defined with one approach, with a component defined using a different approach?

@wkwiatek wkwiatek changed the base branch from next to master March 6, 2017 09:04
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.

1 participant