Answer the question
In order to leave comments, you need to log in
`
How to work with destructuring when declaring in typescript?
For example, in
interface Props {
theme? : object;
}
export const Block = styled.div`
border: ${({mainTheme}: Props) => `${mainTheme.border} ${mainTheme.color}`};
`;
Answer the question
In order to leave comments, you need to log in
It?
interface Props {
theme: Theme;
}
interface Theme {
border: string;
color: string;
}
export const Block = `
border: ${({theme: mainTheme}: Props) => `${mainTheme.border} ${mainTheme.color}`};
`;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question