Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (17 sloc) 596 Bytes
import * as React from 'react';
import { AppContextConsumer } from './TranslationsProvider';
export const withTranslations = (WrappedComponent: React.ComponentClass | React.FunctionComponent) => {
class BoundComponentHOC extends React.Component {
public render() {
return <AppContextConsumer>
{value => <WrappedComponent
{...this.props as any}
appContext={value.state.translations}
changeLanguage={value.changeLanguage}
changeTheme={value.changeTheme}
/>}
</AppContextConsumer>;
}
}
return BoundComponentHOC;
};
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.