采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
这个api 已经废除了 export const Globalstyle = createGlobalStyle ` body { margin: 0; padding: 0; font-family: sans-serif; background:green }
`
这个 api 已被废弃,替代 api 是 createGlobalStyle。原文如下
[Deprecated] injectGlobal
NOTE
The injectGlobal API was removed and replaced by createGlobalStyle in styled-components v4.
原文连链接:https://www.styled-components.com/docs/api
确实已经废除了,还有一点,公共css里面是不是必须要导出常量在index.js引入组件形式公共css才能有效?不像视频里直接引入就能用,是这样吧?
import { GlobalStyle } from './style'
登录后可查看更多问答,登录/注册
主流新技术 React-redux,React-router4,贯穿基础语法
5.6k 22
5.7k 20
2.0k 19
4.4k 17
1.5k 13