React Typescript - Adding custom attribute
there is another way... skipping the static check (typescript don't do dynamic)
{
const allowedProps = {test: "not-data-attribute"}
<span {...allowedProps}/>
}
in react 16+ it is possible, see
probem is that typescript didnt know about it(yet)
but you can still add @ts ignore for typechecking
{ //@ts-ignore
<span name="I'm causing a type error" data-test="I'm Working"/>
}