Style the body element with styled-components and "injectGlobal"

Share this video with your friends

Send Tweet

In this lesson, we see how we can apply styles globally with the "injectGlobal" helper method in styled-components. This method allows us to apply styles on the body element, which cannot be wrapped in a styled-component.

Dean
Dean
~ 7 years ago

Hey Simon, Have you been able to test with Jest, react components using styled-components that are exported from a dedicated "styledComponents.js" file. I love styled-components, but hitting a roadblock with testing.