I am working with a custom textStyle that is of type TextStyle, coming from react-native types, or React.CSSProperties. I want to apply this styling to an html span element using the style attribute. The style attribute only accepts types of React.CSSProperties. Below is my interface and span element:
export interface IBaseTextStyleType {
textStyle: React.CSSProperties | TextStyle
}
<span style={style.textStyle}>
{this.props.children || this.props.text}
</span>
However, I encountered an error with the style of the span:
Type 'CSSProperties | TextStyle' is not assignable to type 'CSSProperties'.
Type 'TextStyle' is not assignable to type 'CSSProperties'.
Types of property 'aspectRatio' are incompatible.
Type 'number' is not assignable to type 'AspectRatio'.
How can I resolve this issue?