-1

This does not work for me: Property does not exist on type 'DetailedHTMLProps, HTMLDivElement>' with React 16

I do not have index.d.ts by default, I created one but it did not help so I put it in a component folder and ts started to complain 'useState does not export from React'.

I am new in typescript. I need something like this:

<div customAtribute="foo"/>bar</div>

1 Answers1

0

Somehow it works... thanks to everyone :)

declare namespace React {
    interface HTMLAttributes<T> extends DOMAttributes<T> {
        customAttribute?: string;
    }
}