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

HOC: expose wrapped component as WrappedComponent property #853

Merged
merged 1 commit into from
May 21, 2019

Conversation

naholyr
Copy link
Contributor

@naholyr naholyr commented May 17, 2019

Hi, this PR will add a public static property WrappedComponent (tests included) to access original component.

It looks like a de facto standard in higher order components, at least that's what react-router and react-redux do, so I expected any higher order component to do the same. This allows to access original component in a standardized way and access its original static properties (in my case, a loadData property used for server-side data fetching, but that could be anything else). Without this property, I can't use your HOC with mine as it "breaks the chain". This PR includes implementation and test 👍

Thanks for your work!

Note: this is quite the same PR which was merged last week in dunglas/react-esi#6

@coveralls
Copy link

coveralls commented May 17, 2019

Coverage Status

Coverage increased (+0.07%) to 91.915% when pulling 64a5ded on naholyr:feat/expose-wrapped-component into 58d508b on i18next:master.

@jamuhl
Copy link
Member

jamuhl commented May 18, 2019

For consistency in the code - can you do the same for: https://github.com/i18next/react-i18next/blob/master/src/withSSR.js

@naholyr
Copy link
Contributor Author

naholyr commented May 20, 2019 via email

@naholyr naholyr force-pushed the feat/expose-wrapped-component branch from 775c866 to 64a5ded Compare May 21, 2019 13:14
@naholyr
Copy link
Contributor Author

naholyr commented May 21, 2019

PR updated with withSSR (force-push to keep it single-commit)

@jamuhl jamuhl merged commit 7481688 into i18next:master May 21, 2019
@jamuhl
Copy link
Member

jamuhl commented May 21, 2019

thank you...was published in react-i18next@10.10.0

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.

3 participants