So this example code:
import { Typography, TypographyProps } from '@material-ui/core';
import { palette, PaletteProps } from '@material-ui/system';
import styled from '@emotion/styled';
type TextProps = Omit<TypographyProps, 'color'> & PaletteProps;
export const Text = styled(Typography)<TextProps>`
${palette}
`;
Does not work as you'd expect. The idea here is: color is typed any in PaletteProps, but it is typed "inherit" | "primary" | "secondary" | "textPrimary" | ... | undefined in TypographyProps. What I wanted to do is overwrite the color prop, so I could use @material-ui/system's color, instead of Typography's color prop.
Maybe I'm doing something wrong or maybe there's something I haven't accounted for. Here's a CodeSandbox URL with the error being reproduced:
https://codesandbox.io/s/b36zs?file=/src/App.tsx
(hover the <Text ...> component for the Typescript error - it doesn't prevent the compilation there, but locally that does not work at all).
What am I missing here?