1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 13:40:20 +02:00

Add fix for broken type hinting on class components (#2962)

This commit is contained in:
David Wheatley
2021-07-14 15:13:57 +01:00
committed by GitHub
parent 9ff1a42396
commit 5a1948c4fc

View File

@@ -30,6 +30,19 @@ declare global {
interface JQuery {
tooltip: TooltipJQueryFunction;
}
/**
* For more info, see: https://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking
*
* In a nutshell, we need to add `ElementAttributesProperty` to tell Typescript
* what property on component classes to look at for attribute typings. For our
* Component class, this would be `attrs` (e.g. `this.attrs...`)
*/
namespace JSX {
interface ElementAttributesProperty {
attrs: Record<string, unknown>;
}
}
}
/**