Skip to content

TS typing for style/xstyle prop on component for custom style application #894

Answered by predaytor
mattstyles asked this question in Q&A
Discussion options

You must be logged in to vote

StyleXStyles is already accepts arrays by default, wdym?

export type StyleXStyles<
  CSS extends UserAuthoredStyles = CSSPropertiesWithExtras,
> = StyleXArray<
  | null
  | undefined
  | false
  | GenStylePropType<CSS>
  | Readonly<[GenStylePropType<CSS>, InlineStyles]>
>;
export type StyleXArray<T> = T | ReadonlyArray<StyleXArray<T>>;

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by mattstyles
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@nmn
Comment options

nmn Feb 24, 2025
Collaborator

@mattstyles
Comment options

@nmn
Comment options

nmn Mar 3, 2025
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants