Sanitize.css for styled-components
npm install styled-sanitize.css
or
yarn add styled-sanitize.css
import React from "react";
import Sanitize from "styled-sanitize.css";
const App = () => (
<>
<Sanitize />
<h1>Hello world</h1>
</>
);
You can also use the named export to customize:
import React from 'react';
import { createGlobalStyle } from 'styled-components';
import { sanitize } from 'styled-sanitize.css';
const GlobalStyle = createGlobalStyle`
${sanitize}
/* more styles */
`
const App = () => (
<>
<GlobalStyle />
<h1>Hello world</h1>
</>
}