I am working on an application that makes use of schema.org. I have the following line:
<span itemProp="priceCurrency" content="EUR">€</span>
Based on the schema.org docs the content
attribute is allowed.
Note that both RDFa and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting.
However, I don't know how to fix this TS error:
Property 'content' does not exist on type 'DetailedHTMLProps<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>'
Grateful for any ideas!
CodePudding user response:
This solved the TS-error:
declare module 'react' {
interface HTMLAttributes<T> {
// extends React's HTMLAttributes
content?: string;
}
}
CodePudding user response:
The property priceCurrency
description tells us:
Use standard formats: ISO 4217 currency format
In turn, the ISO 4217 format mentions the euro with the code EUR.
Try using Schema recommendation.