Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
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;
};