I’m trying to rewrite a react checkout extension using preact and polaris components. The current version allows the end user to pick the styling of the text in each paragraph:
This was done using this code:
I’d like for the user to have the same ability for the Polaris text component, but need help figuring out how to make text type dynamic:
The error I’m getting is:
Type ‘string | number | boolean’ is not assignable to type ‘TextType’.
Type ‘string’ is not assignable to type ‘TextType’.ts(2322)
Text.d.ts(32, 5): The expected type comes from property ‘type’ which is declared here on type ‘TextProps & BaseElementPropsWithChildren’
I’d appreciate any help with figuring out a way around this.



