menu

styled-components

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress!

Channels
Team

Whats the difference between createGlobalStyle and injectGlobal?

September 5, 2018 at 5:04pm

Whats the difference between createGlobalStyle and injectGlobal?

September 5, 2018 at 5:04pm (Edited 1 year ago)

September 5, 2018 at 5:36pm
A brand new createGlobalStyle API, the hot-reloadable and themable replacement for the old injectGlobal
like-fill
4
  • reply
  • like

September 6, 2018 at 5:54am

The main difference is that it creates a component that you have to render in any of your views. The values that you send to the function remain the same.

  • reply
  • like

September 11, 2018 at 5:25pm

injectGlobal is a one-off drop of styles on the page, whereas createGlobalStyle can be updated, themed, and passed props like a normal styled component but still places its styles in the global scope

like-fill
6
  • reply
  • like