1. 用createGlobalStyle定义全局样式
import { createGlobalStyle } from 'styled-components'
export const Globalstyle = createGlobalStyle`
body{
margin: 0;
padding: 0
}`
然后按照样式组件引入即可
2. 在项目主文件导入样式
import { Globalstyle } from './style'
3.以样式组件的方式当作标签引入
render() {
return (
<div>
<Globalstyle/>
</div>
);