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 introspection access to the component wrapped by InjectIntl #219

Merged
merged 3 commits into from
Nov 24, 2015

Conversation

akx
Copy link
Contributor

@akx akx commented Nov 16, 2015

Access to the wrapped components (when not mounted) is useful for universal apps; for instance @erikras' universal example depends on being able to find certain static functions.

This PR also fixes an incidental typo in injectIntl and a couple mis-copypasted tests.

This is useful for universal apps, to be able to access statics
set in the actual rendering component.

(This mirrors what react-redux's Connect already does.)
@ericf
Copy link
Collaborator

ericf commented Nov 16, 2015

@akx thanks for finding and fixing my silly typos! As for the adding the WrappedComponent property, this seems related to #196 and #197. Do you mind adding to the discussion in #196? I'm trying to have a full understanding of what people are looking to do with this feature.

ericf added a commit that referenced this pull request Nov 24, 2015
Allow introspection access to the component wrapped by InjectIntl
@ericf ericf merged commit bda0734 into formatjs:master Nov 24, 2015
@analyst74
Copy link

@ericf just to add context, allowing inspecting into the wrapped component allows unit testing with shallow rendering. But in that use case, hoisting is not necessary, and being able to access WrappedComponent like in this PR is sufficient.

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.

None yet

3 participants