chore: Change name from SafeReactNode to StrictReactNode

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 e88de58b5d
commit d8823085a8
75 files changed
+219 -210

No files matched your search

@@ -8,7 +8,7 @@ import "./tooltip.scss";
import React from "react";
import { createPortal } from "react-dom";
import { observer } from "mobx-react";
import type { IClassName, SafeReactNode } from "@k8slens/utilities";
import type { IClassName, StrictReactNode } from "@k8slens/utilities";
import { cssNames } from "@k8slens/utilities";
import { observable, makeObservable, action, runInAction } from "mobx";
import autoBindReact from "auto-bind/react";
@@ -35,7 +35,7 @@ export interface TooltipProps {
className?: IClassName;
formatters?: TooltipContentFormatters;
style?: React.CSSProperties;
children?: SafeReactNode;
children?: StrictReactNode;
"data-testid"?: string;
}
@@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import type { SafeReactNode } from "@k8slens/utilities";
import type { StrictReactNode } from "@k8slens/utilities";
import { render, RenderResult } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import React from "react";
@@ -12,7 +12,7 @@ import { withTooltip } from "./withTooltip";
type MyComponentProps = {
text: string;
id?: string;
children?: SafeReactNode;
children?: StrictReactNode;
"data-testid"?: string;
};
@@ -6,19 +6,18 @@
import React, { useState } from "react";
import type { TooltipProps } from "./tooltip";
import { Tooltip } from "./tooltip";
import { isReactNode, SafeReactNode } from "@k8slens/utilities";
import { isReactNode, StrictReactNode } from "@k8slens/utilities";
import uniqueId from "lodash/uniqueId";
import type { SingleOrMany } from "@k8slens/utilities";
export interface TooltipDecoratorProps {
tooltip?: SafeReactNode | Omit<TooltipProps, "targetId">;
tooltip?: StrictReactNode | Omit<TooltipProps, "targetId">;
/**
* forces tooltip to detect the target's parent for mouse events. This is
* useful for displaying tooltips even when the target is "disabled"
*/
tooltipOverrideDisabled?: boolean;
id?: string;
children?: SafeReactNode;
children?: StrictReactNode;
}
export function withTooltip<TargetProps>(