@types/rebass is supported rebass v3.
Are there any plans to update the type definition to support v4?
In the meantime, you can use this workaround
create rebass.d.ts with this content:
declare module 'rebass/styled-components' {
import * as r from 'rebass';
import { CSSObject } from 'styled-components';
export interface BaseProps {
sx?: CSSObject;
}
export = r;
}
@martasko it does not work with new props like maxWidth, overflow and others.
Need typings!
I've created a PR a few seconds ago in DefinitelyTyped, please take a look and see if I missed anything 馃檹
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/37709
I've created a PR a few seconds ago in DefinitelyTyped, please take a look and see if I missed anything 馃檹
DefinitelyTyped/DefinitelyTyped#37709
Is there support for theme config variables checking? I don't see it...
For example:
export const Header = ({ transparent }: { transparent?: boolean }) => (
<Box bg={['secondary', 'secondary', transparent ? 'transparent' : 'primary']} />
)
No validation of enum secondary and primary of theme.colors
We need to to pass ThemedStyledInterface<Theme> of styled-components to rebass and configure relations by the props table.
Maybe it will be easier if we could use functions in props with passing theme.
No, I've only adapted the existing typings to work with v4, didn't add any features.
I understand, but it's not usable in production because there are no checking of theme.
It's merged! 馃嵕
Closing this since it sounds like the type definitions have been updated
Most helpful comment
It's merged! 馃嵕