fluent.js icon indicating copy to clipboard operation
fluent.js copied to clipboard

hoist static functions in withLocalization

Open blushingpenguin opened this issue 6 years ago • 2 comments

This hoists static functions in components decorated using withLocalization as per https://reactjs.org/docs/higher-order-components.html

blushingpenguin avatar Oct 02 '19 14:10 blushingpenguin

How does this relate/interact to/with the work @Gregoor started in #406?

Pike avatar Oct 02 '19 14:10 Pike

How does this relate/interact to/with the work @Gregoor started in #406?

They are tangential -- in that PR withLocalization has been reimplemented using react hooks instead of context -- the behaviour wrt to static functions is the same. The two changes do conflict, but only in a minor way -- AFAICS the only difference needed would be:

return hoistNonReactStatics(WithDisplay, Inner);

in fluent-react/src/with_localization.js

blushingpenguin avatar Oct 02 '19 15:10 blushingpenguin