Skip to content

Commit

Permalink
fix: do not use React global type
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Jul 29, 2024
1 parent 846af74 commit 1566417
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/app/panels/measurements/measurementPanelContext.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Panel } from '@blueprintjs/core';
import { createContext, useContext } from 'react';
import { createContext, type ReactNode, useContext } from 'react';

export interface MeasurementState {
openPanel?: (panel: Panel<object>) => void;
Expand All @@ -21,7 +21,7 @@ export function MeasurementPanelProvider({
children,
value,
}: {
children: React.ReactNode;
children: ReactNode;
value: MeasurementState;
}) {
return (
Expand Down
3 changes: 2 additions & 1 deletion src/components/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { HTMLTable } from '@blueprintjs/core';
import {
Children,
HTMLAttributes,
isValidElement,
ReactElement,
ReactNode,
Expand All @@ -28,7 +29,7 @@ function splitChildren(children: ReactNode) {
}
return { Rows, Header };
}
export interface TableProps extends React.HTMLAttributes<HTMLTableElement> {
export interface TableProps extends HTMLAttributes<HTMLTableElement> {
children?: ReactNode;
bordered?: boolean;
compact?: boolean;
Expand Down
4 changes: 3 additions & 1 deletion src/components/table/TableHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { CSSProperties } from 'react';

import type { TableProps } from './Table';
import { TableRow } from './TableRow';

const headerStyle: React.CSSProperties = {
const headerStyle: CSSProperties = {
position: 'sticky',
top: 0,
zIndex: 10,
Expand Down
3 changes: 2 additions & 1 deletion src/components/toolbar/PanelPreferencesToolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
/** @jsxImportSource @emotion/react */
import { css } from '@emotion/react';
import type { ReactNode } from 'react';

import { Toolbar } from './Toolbar';

interface PanelPreferencesToolbarProps {
title?: React.ReactNode;
title?: ReactNode;
onClose?: () => void;
onSave?: () => void;
}
Expand Down
4 changes: 2 additions & 2 deletions stories/components/table.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentType } from 'react';
import { ComponentType, HTMLAttributes } from 'react';

import { Table, ValueRenderers } from '../../src/components/index';
import data from '../data/table.json';
Expand All @@ -7,7 +7,7 @@ interface TableStoryProps {
border: boolean;
}

interface ControlProps extends React.HTMLAttributes<HTMLTableElement> {
interface ControlProps extends HTMLAttributes<HTMLTableElement> {
bordered?: boolean;
compact?: boolean;
interactive?: boolean;
Expand Down

0 comments on commit 1566417

Please sign in to comment.