React Imported SVG as CSS Background

Sun Jul 28 2019

** You will need to have styled-components

import { renderToStaticMarkup } from 'react-dom/server';

const DividerWave = styled.div`
  background: ${`url("data:image/svg+xml,${
    encodeURIComponent(renderToStaticMarkup(<BoiledEggSvg />))
  }")`}
`