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

Add <Subscriber quiet> prop to avoid invariant when rendered out of context #41

Closed
mjackson opened this issue Nov 29, 2017 · 1 comment

Comments

@mjackson
Copy link
Member

Currently, if you render a <Subscriber> out of context it'll throw an invariant. This is similar to the context API itself, where if you try to use this.context.cupcakes outside the appropriate context you'll get an error.

What we don't have is a way for users to opt-out of the invariant when they're not rendered in the right context. This would be the equivalent of the isRequired functionality currently available to consumers of the context API through contextTypes.

The idea would be to add <Subscriber quiet> to opt-out of the invariant in these situations.

@mjackson
Copy link
Member Author

I should also note that in the case a <Subscriber quiet> is rendered out of context its value should be undefined instead of null, same as this.context.cupcakes would be out of context.

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

No branches or pull requests

1 participant