#Conditional React prop with optional Generic

1 messages · Page 1 of 1 (latest)

broken vineBOT
#
costaNull#0127

Preview:```ts
import React from "react"

const TypographyDefaultMapping = {
h1: "h1",
h2: "h2",
h3: "h3",
"body-medium": "span",
label: "span",
} as const

export type TypographyVariants =
keyof typeof TypographyDefaultMapping

type Tags = keyof HTMLElementTagNameMap
...```

willow forge
#

It should work as the image:

#

While the type-testing works, the react component does not

willow forge