Answer the question
In order to leave comments, you need to log in
How to extract content from a custom type into a property?
Good afternoon, do not tell me how you can extract all the content from a custom type?
For example:
I have an interface with a property
export interface ContainerProps {
xAlign?: DefaultAlignXModifiers,
}
Answer the question
In order to leave comments, you need to log in
I must say right away - I am not an expert on TS, try this option:
const roArray: ReadonlyArray<string> = ["center", "left", "right"];
type DefaultAlignXModifiers = roArray;
interface ContainerProps {
xAlign?: DefaultAlignXModifiers,
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question