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鈥檒l 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 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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

naholyr commented May 20, 2019

@naholyr naholyr force-pushed the naholyr:feat/expose-wrapped-component branch from 775c866 to 64a5ded May 21, 2019
@naholyr

This comment has been minimized.

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
4 checks passed
4 checks passed
ci/circleci: build Your tests passed on CircleCI!
Details
codeclimate All good!
Details
coverage/coveralls Coverage increased (+0.07%) to 91.915%
Details
workflow Workflow: workflow
Details
@jamuhl

This comment has been minimized.

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
Projects
None yet
3 participants
You can鈥檛 perform that action at this time.