Skip to content

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