Skip to content

Commit

Permalink
Use stable public context API (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
tstirrat15 authored and frenzzy committed Mar 8, 2019
1 parent 33086a4 commit 5822c4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/withStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import StyleContext from './StyleContext'
function withStyles(...styles) {
return function wrapWithStyles(ComposedComponent) {
class WithStyles extends React.PureComponent {
constructor(props, context) {
super(props, context)
this.removeCss = context.insertCss(...styles)
constructor(props) {
super(props)
this.removeCss = this.context.insertCss(...styles)
}

componentWillUnmount() {
Expand Down

0 comments on commit 5822c4a

Please sign in to comment.