Skip to content

Commit

Permalink
Remove some occurrences of ts-ignore (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
willeastcott authored May 1, 2024
1 parent acb6830 commit 7d8cf71
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/components/GridView/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import BaseComponent from '../Element/component';
class GridView extends BaseComponent <GridViewArgs, any> {
constructor(props: GridViewArgs) {
super(props);
// @ts-ignore
this.element = new GridViewElement({ ...props });
this.loadChildren(this.props.children, this.element);
}
Expand All @@ -21,8 +20,7 @@ class GridView extends BaseComponent <GridViewArgs, any> {
children = [children];
}
children.forEach((child: any) => {
// @ts-ignore
const childElement = new GridViewItemElement({ text: child.props.text, open: false });
const childElement = new GridViewItemElement({ text: child.props.text });
element.append(childElement);
this.loadChildren(child.props.children, childElement);
});
Expand Down
1 change: 0 additions & 1 deletion src/components/LabelGroup/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { JSXElementConstructor, ReactElement } from 'react';
class LabelGroup extends BaseComponent <LabelGroupArgs, any> {
constructor(props: LabelGroupArgs) {
super(props);
// @ts-ignore
this.elementClass = Element;
}

Expand Down
4 changes: 2 additions & 2 deletions src/components/Menu/component.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export default meta;
type Story = StoryObj<typeof Menu>;

window.addEventListener('contextmenu', (evt: MouseEvent) => {
// @ts-ignore
if (evt.target.ui instanceof LabelElement) {
const target = evt.target as HTMLElement;
if (target.ui instanceof LabelElement) {
const element = document.querySelector('.pcui-menu');
if (element) {
const menu = element.ui as MenuElement;
Expand Down
1 change: 0 additions & 1 deletion src/components/Menu/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class Menu extends BaseComponent <MenuArgs, any> {
}

onDivLoaded = (element: any) => {
// @ts-ignore
this.element = new Element({ ...this.props, dom: element });
};

Expand Down

0 comments on commit 7d8cf71

Please sign in to comment.