Skip to content

Type issue when using themes #292

Answered by mattcompiles
rtkaaho asked this question in Q&A
Discussion options

You must be logged in to vote

OK this was a strange one. It seems that using createThemeContract with null values doesn't work when strictNullChecks is not enabled. We may consider updating some examples to avoid this confusion.

Either way though you have two options:

  • Enable strictNullChecks or strict in your tsconfig.json
  • Instead of using null, use a string value e.g.
    export const contract = createThemeContract({
      color: {
        brand: ''
      },
      font: {
        body: ''
      }
    });
    

Replies: 3 comments 4 replies

Comment options

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

@rtkaaho
Comment options

Comment options

You must be logged in to vote
1 reply
@mattcompiles
Comment options

Comment options

You must be logged in to vote
1 reply
@rtkaaho
Comment options

Answer selected by mattcompiles
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