react-styled-componedts ('injectGlobal' is not exported from 'styled-components'.)

v4.0 更换成了 createGlobalStyle 

style中

定义const GlobalStyle = createGlobalStyle``

export default GlobalStyle

在App组件中

import store from './store';

<Provider store={store}>
 <Fragment>
     <Header/>
     <GlobalStyle/>
     <GlobalStyleIconfont/>
 </Fragment>
</Provider>



文档https://www.styled-components.com/docs/api


posted @ 2019-07-17 21:16  进击的三三  阅读(841)  评论(0编辑  收藏  举报