0

我想做这个:

* {
-webkit-box-sizing: border-box;
   -moz-box-sizing: border-box;
        box-sizing: border-box;
}

我应该如何使用样式组件并做出反应?有新的 createGlobalStyle API,但我不确定它如何处理星号?

4

1 回答 1

2

使用 . 创建新的以下组件createGlobalStyle

import { createGlobalStyle } from 'styled-components';


const GlobalStyle = createGlobalStyle`

* {
-webkit-box-sizing: border-box;
   -moz-box-sizing: border-box;
        box-sizing: border-box;
}

`;

export default GlobalStyle;

然后在您的App component.

于 2019-02-28T17:47:39.387 回答