question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

withI18n does not copy over static methods

See original GitHub issue

As stated in React docs when creating a HOC, you need to copy over the static methods,

Some of my components declare static properties, but they are undefined when using withI18n

This fix is simple, the only addition is to call hoistNonReactStatic over the hoisted and original component

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tricoder42commented, Feb 21, 2018

Make sense, I’ll add it to keep HOC behavior consistent.

0reactions
tricoder42commented, Jul 23, 2018

Fixed in latest release v2.3.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

statics when using withTranslation · Issue #736 - GitHub
Im using withTranslation with React Navigation and would like to set the headerTitle using static navigationOptions, but when using the ...
Read more >
Static HTML Export with i18n compatibility in Next.js - DEV ...
Executing next export when not using i18n seems to work. What if we do not try to use the internationalized routing feature and...
Read more >
Why can't interfaces specify static methods? - Stack Overflow
Suppose you could specify in an interface that a type had to have a particular static method... how would you call it? Polymorphism...
Read more >
static - JavaScript - MDN Web Docs - Mozilla
Static methods are often utility functions, such as functions to create or clone objects, whereas static properties are useful for caches, fixed ...
Read more >
Static Classes and Static Class Members - C# guide
Only one copy of a static member exists, regardless of how many instances of the class are created. Static methods and properties cannot...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found