fix: Don't crash when hovering hotbar menu index

- Remove all uses of React.ReactNode as it is unsafe, replace them with
  usages of SafeReactNode which doesn't contain the '{}' type

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-05-15 11:56:30 -04:00
1 parent f13a145a27
commit 9d51ef2aa6
84 files changed
+246 -208

No files matched your search

+1
View File
@@ -33,6 +33,7 @@
},
"peerDependencies": {
"@k8slens/kube-object": "^1.0.0-alpha.1",
"@k8slens/utilities": "^1.0.0-alpha.3",
"@ogre-tools/injectable": "^15.8.1",
"react": "^17.0.2"
},
@@ -4,7 +4,7 @@
*/
import type { KubeObject } from "@k8slens/kube-object";
import type { ReactNode } from "react";
import type { SafeReactNode } from "@k8slens/utilities";
import type { TableSortCallback, SearchFilter, TableCellProps } from "./list-layout-column";
export interface BaseKubeObjectListLayoutColumn<K extends KubeObject> {
@@ -13,7 +13,7 @@ export interface BaseKubeObjectListLayoutColumn<K extends KubeObject> {
sortingCallBack?: TableSortCallback<K>;
searchFilter?: SearchFilter<K>;
header: TableCellProps | undefined | null;
content: (item: K) => ReactNode | TableCellProps;
content: (item: K) => SafeReactNode | TableCellProps;
}
export interface GeneralKubeObjectListLayoutColumn extends BaseKubeObjectListLayoutColumn<KubeObject> {
@@ -3,8 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import type { ReactNode } from "react";
import type { SingleOrMany } from "@k8slens/utilities";
import type { SafeReactNode, SingleOrMany } from "@k8slens/utilities";
export interface ItemObject {
getId: () => string;
@@ -37,7 +36,7 @@ export interface TableCellProps extends React.DOMAttributes<HTMLDivElement> {
/**
* The actual value of the cell
*/
title?: ReactNode;
title?: SafeReactNode;
/**
* content inside could be scrolled