tengo este componente y no puedo usar el tema con mecanografiado
const buttonDisabled = css` color: ${({ theme }) => theme.color}; `;¿Cómo puedo escribir este componente?
error: No overload matches this call. Overload 1 of 2, '(template: TemplateStringsArray, ...args: CSSInterpolation[]): SerializedStyles', gave the following error. Argument of type '({ theme }: { theme: any; }) => any' is not assignable to parameter of type 'CSSInterpolation'. Type '({ theme }: { theme: any; }) => any' is missing the following properties from type 'CSSInterpolation[]': pop, push, concat, join, and 28 more.Obtenga ayuda de su documentación oficial, tiene todo lo relacionado para crear un componente en emoción https://emotion.sh/docs/styled y la forma más simple de crear un componente usando emoción css es
import styled from '@emotion/styled' const Button = styled.button` color: turquoise; ` render(<Button>This my button component.</Button>)pasar accesorios
import "./styles.css"; import styled from "@emotion/styled"; export const DIV = styled.div` background-color: pink; color: ${(props) => props.color}; `; export default function App() { return ( <div className="App"> <h1>Hello CodeSandbox</h1> <h2>Start editing to see some magic happen!</h2> <DIV color="blue">Hello World</DIV> </div> ); }y si solo quieres usar css
import "./styles.css"; import {css} from '@emotion/css'; const color = 'blue'; export const buttonDisabled = css` color:${color} `; export default function App() { return ( <div className="App"> <h1>Hello CodeSandbox</h1> <h2>Start editing to see some magic happen!</h2> <div className={buttonDisabled}>Hello World</div> </div> ); }