报错内容
Failed to compile
./src/style.js
Line 3: 'injectGloabl' is not defined no-undef
Search for the keywords to learn more about each error.
报错代码
import { injectGlobal } from 'styled-components';
injectGloabl`
body{
margin: 0;
padding: 0;
font-family: sans-serif;
}
`
修改后
import { createGlobalStyle } from 'styled-components';
createGlobalStyle`
body{
margin: 0;
padding: 0;
font-family: sans-serif;
}
`
参考:https://blog.csdn.net/qq_42817227/article/details/85608073