cssta
cssta copied to clipboard
Typescript + Props
How to configure the use of typescript, and how to pass a property into the component using typescript
Sorry, I need to add the types to the project. You can use this though,
declare module 'cssta/native' {
type CssConstructor<T> = (
css: TemplateStringsArray,
...values: (string | number | (() => any))[]
) => T;
type ComponentConstructor = <T = {}>(
component: React.ElementType<T>,
) => CssConstructor<React.ElementType<T & Record<string, any>>>;
type Mixin = {
mixin: CssConstructor<any>;
};
const styled: ComponentConstructor & Mixin;
export default styled;
}
Old this lib has everything to be better than Styled-Components ... Not to update it, because this lib is fantastic ....
I used it today I did some tests and I loved it, I'm thinking about abandoning the styled components kkkk I just had a little problem with typescript, and also with the extension of the styled components of vscode