We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
wrapper.context()
Similar to wrapper.props, there should be an api to introspect into the context of a component.
wrapper.props
The vernacular is sort of weird if we want to mimic the prop/props style as it would be:
prop
props
wrapper.contexts() // returns entire context object wrapper.context('foo') // returns foo from the context object
Part of me thinks the word contexts sounds weird. We could do this for an API:
contexts
wrapper.context() // no argument - returns entire context object wrapper.context('foo') // returns foo from the context object
though this might cause some confusion and unreliability to the API. Thoughts?
The text was updated successfully, but these errors were encountered:
@blainekasten the .state() and .state('foo') API is like the latter and I think would make sense...
.state()
.state('foo')
I'm not strictly sure we are able to do this though? We might need to specify childContextTypes before-hand.... I'm really not sure though.
childContextTypes
Sorry, something went wrong.
I've been doing it hackily by this code:
wrapper.node.context; // full context wrapper.node.context[arg] // context item
Is it not internally safe to depend on the node item? If it is, this API could be really simple to implement. I'll give it a test in a bit.
node
No branches or pull requests
Similar to
wrapper.props
, there should be an api to introspect into the context of a component.The vernacular is sort of weird if we want to mimic the
prop
/props
style as it would be:Part of me thinks the word
contexts
sounds weird. We could do this for an API:though this might cause some confusion and unreliability to the API. Thoughts?
The text was updated successfully, but these errors were encountered: