Config `container` typing is incorrect
Closed this issue ยท 2 comments
michael-eightnine commented
The typing for the container
property in IConfig
seems inaccurate based on the docs. It expects a number container: Record<IGridBreakpoints, number>
however the docs indicate you can pass a string "full"
. Currently I've fixed this at the implementation point by redefining IConfig
, but was curious if this is a true bug or if I've misunderstood the docs.
Overall:
interface IConfig {
media: Record<IGridBreakpoints, ThemedCssFunction<DefaultTheme>>;
mediaQuery: string;
columns: Record<IGridBreakpoints, number>;
gutterWidth: Record<IGridBreakpoints, number>;
paddingWidth: Record<IGridBreakpoints, number>;
container: Record<IGridBreakpoints, number>;
breakpoints: Record<IGridBreakpoints, number>;
}
should likely become
interface IConfig {
media: Record<IGridBreakpoints, ThemedCssFunction<DefaultTheme>>;
mediaQuery: string;
columns: Record<IGridBreakpoints, number>;
gutterWidth: Record<IGridBreakpoints, number>;
paddingWidth: Record<IGridBreakpoints, number>;
container: Record<IGridBreakpoints, number | string>;
breakpoints: Record<IGridBreakpoints, number>;
}
santosfrancisco commented
Hi @michael-eightnine thanks for reporting. It really is a bug and I will fix it. I thought about the solution below, since we accept string, but only 'full'. What do you think?
how about
container: Record<IGridBreakpoints, number | 'full'>;
santosfrancisco commented
Done! Please check version 3.1.4 ๐