Skip to content

Reusable styles function return type #103

Answered by roginfarrer
richbachman asked this question in Q&A
Discussion options

You must be logged in to vote

You might try the new satisfies operator if your version of TS supports it. as const may also work. I imagine TS is not inferring the value 'unset' literally, and instead just taking it as string

const baseStyles = () => {
  return {
    all: 'unset',
    padding: '$space10',
  } satisfies Sprinkles;
};

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@roginfarrer
Comment options

Answer selected by roginfarrer
@richbachman
Comment options

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