mirror of
https://github.com/flarum/core.git
synced 2025-08-06 16:36:47 +02:00
TS: Be more specific in type assertion
See https://stackoverflow.com/a/33404548.
This commit is contained in:
@@ -108,7 +108,7 @@ export default abstract class Component<T extends ComponentAttrs = any> implemen
|
|||||||
* and checking for common issues.
|
* and checking for common issues.
|
||||||
*/
|
*/
|
||||||
private setAttrs(attrs: T = {} as T): void {
|
private setAttrs(attrs: T = {} as T): void {
|
||||||
(this.constructor as any).initAttrs(attrs);
|
(this.constructor as typeof Component).initAttrs(attrs);
|
||||||
|
|
||||||
if (attrs) {
|
if (attrs) {
|
||||||
if ('children' in attrs) {
|
if ('children' in attrs) {
|
||||||
|
Reference in New Issue
Block a user