Skip to content

Commit

Permalink
Move injectGlobal to outside of the component fix #11
Browse files Browse the repository at this point in the history
  • Loading branch information
diegohaz committed Nov 22, 2016
1 parent 408f9f5 commit 90a0058
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
14 changes: 6 additions & 8 deletions src-clean/components/App.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import React, { PropTypes, Component } from 'react'
import { injectGlobal } from 'styled-components'

injectGlobal`
body {
margin: 0;
}
`

class App extends Component {
static propTypes = {
children: PropTypes.any
}

componentWillMount () {
injectGlobal`
body {
margin: 0;
}
`
}

render () {
const { children } = this.props
return (
Expand Down
14 changes: 6 additions & 8 deletions src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import React, { PropTypes, Component } from 'react'
import { injectGlobal } from 'styled-components'

injectGlobal`
body {
margin: 0;
}
`

class App extends Component {
static propTypes = {
children: PropTypes.any
}

componentWillMount () {
injectGlobal`
body {
margin: 0;
}
`
}

render () {
const { children } = this.props
return (
Expand Down

0 comments on commit 90a0058

Please sign in to comment.