I create below TypeScript types:
import { MyType, SectionTheme } from 'app/store/types';
export type Props = {
data: MyType;
} & SectionTheme;
export type StylesProps = ThemeProps & Pick<Props, 'theme'>;
How do I make theme optional?
Do I have to go to SectionTheme type and add ? like:
export type SectionTheme = {
theme?: 'one' | 'two';
};
Or do I have to use utility Partial type? And how exactly. What's the difference and what is better to use in my case?