fix: injectLocale should work in IE<=10 (#5488)

This commit is contained in:
Benjy Cui 2017-03-26 10:02:34 +08:00 committed by Benjy Cui
parent f0ec7b749a
commit 0beb892971

View File

@ -10,8 +10,12 @@ export interface ComponentContext {
export default (componentName: string, defaultLocale) => (
function<P>(Component: typeof React.Component): React.ComponentClass<P> {
const ComponentWithStatics = Component as any;
return class extends Component<P & ComponentProps, any> {
static propTypes = ComponentWithStatics.propTypes;
static defaultProps = ComponentWithStatics.defaultProps;
static contextTypes = {
...(ComponentWithStatics.context || {}),
antLocale: PropTypes.object,
};