Skip to content

Added hoist-non-react-statics to withLocalized HOC #130

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

Merged

Conversation

ramyma
Copy link
Contributor

@ramyma ramyma commented Oct 17, 2018

I wanted to use a static method in a react class component in SSR, but I noticed that the static functions aren't hoisted in withLocalize HOC.

This PR adds to withLocalize HOC automatic hoisting to non react statics using hoist-non-react-statics as per https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over

@codecov
Copy link

codecov bot commented Oct 17, 2018

Codecov Report

Merging #130 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #130   +/-   ##
======================================
  Coverage    96.4%   96.4%           
======================================
  Files           6       6           
  Lines         250     250           
  Branches       76      76           
======================================
  Hits          241     241           
  Misses          8       8           
  Partials        1       1
Impacted Files Coverage Δ
src/withLocalize.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3eb5875...5df7f5b. Read the comment docs.

@ramyma
Copy link
Contributor Author

ramyma commented Oct 17, 2018

I'm sorry if that's a duplicate PR, I didn't realize there was another PR regarding the same issue.

It would be nice to have either merged as soon as possible.

Thanks!

@ramyma ramyma force-pushed the with_localize_hoist_statics branch from 9e10edf to 5df7f5b Compare October 17, 2018 13:11
@ryandrewjohnson
Copy link
Owner

Thanks for the PR will have a closer look in the next couple days.

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.

2 participants