styled-components / General

Whats the difference between createGlobalStyle and injectGlobal?

Whats the difference between createGlobalStyle and injectGlobal?

styled-components/General · September 5, 2018 at 5:04pm

Whats the difference between createGlobalStyle and injectGlobal?

styled-components / General · September 5, 2018 at 5:04pm (Edited 6 months 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

Log in or sign up to chat