[英]WebStorm can't autocomplete styled-components
您提供給 styled-component 的 function 應返回“css” object,您將從 styled-components 庫中導入命名為 import。
import styled, { css } from 'styled-components';
const Button = styled.button(({ theme, size, type }) => css`
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
padding: 16px 32px;
background-color: ${theme.paper};
color: ${theme.brand};
font: ${theme.medium16};
border-radius: 8px;
border: solid 0.8px ${theme.brand};
cursor: pointer;
`);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.