From 1f4306a666a2259e22de43722b30a3aa718f4cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phil=20Pl=C3=BCckthun?= Date: Mon, 22 May 2017 04:15:15 +0100 Subject: [PATCH 1/2] Set StyledComponent context directly on every class --- src/models/StyledComponent.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/models/StyledComponent.js b/src/models/StyledComponent.js index 06ba797d2..499c3c8ea 100644 --- a/src/models/StyledComponent.js +++ b/src/models/StyledComponent.js @@ -1,6 +1,7 @@ // @flow import { createElement } from 'react' +import PropTypes from 'prop-types' import type { Theme } from './ThemeProvider' import createWarnTooManyClasses from '../utils/createWarnTooManyClasses' @@ -191,6 +192,11 @@ export default (ComponentStyle: Function, constructWithOptions: Function) => { ) class StyledComponent extends ParentComponent { + static contextTypes = { + [CHANNEL]: PropTypes.func, + [CONTEXT_KEY]: PropTypes.instanceOf(StyleSheet), + } + static displayName = displayName static styledComponentId = componentId static attrs = attrs From 84d4df4f6f0eb7758b4ed4d5905133313d75cbf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phil=20Pl=C3=BCckthun?= Date: Mon, 22 May 2017 11:42:23 +0100 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6381c4f8..799e8e527 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ All notable changes to this project will be documented in this file. If a contri - Add `innerRef` support to `withTheme` HOC. (see [#710](https://github.com/styled-components/styled-components/pull/710)) - Switch to babel-preset-env. (see [#717](https://github.com/styled-components/styled-components/pull/717)) - Update StyledNativeComponent to match StyledComponent implementation. +- Fix Theme context for StyledComponent for IE <10. (see [#807](https://github.com/styled-components/styled-components/pull/807)) ## [Unreleased]