Explicitly define return type

This commit is contained in:
Nathan Bierema 2023-12-16 11:42:59 -05:00
parent 1a2fef9f27
commit 0d877113c9
5 changed files with 10 additions and 5 deletions

View File

@ -18,6 +18,7 @@ import {
verticalListSortingStrategy,
} from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
import type { JSX } from '@emotion/react/jsx-runtime';
import ActionListRow from './ActionListRow';
import ActionListHeader from './ActionListHeader';
@ -80,7 +81,7 @@ export default function ActionList<A extends Action<string>>({
onJumpToState,
lastActionId,
onReorderAction,
}: Props<A>) {
}: Props<A>): JSX.Element {
const nodeRef = useRef<HTMLDivElement | null>(null);
const prevLastActionId = useRef<number | undefined>();

View File

@ -4,6 +4,7 @@ import type { DebouncedFunc } from 'lodash';
import debounce from 'lodash.debounce';
import { Action } from 'redux';
import type { Interpolation, Theme } from '@emotion/react';
import type { JSX } from '@emotion/react/jsx-runtime';
import RightSlider from './RightSlider';
import {
selectorButtonCss,
@ -52,7 +53,7 @@ export default class ActionListRow<
> extends PureComponent<Props<A>, State> {
state: State = { hover: false };
render() {
render(): JSX.Element {
const {
isSelected,
action,

View File

@ -4,6 +4,7 @@ import { Action } from 'redux';
import type { LabelRenderer } from 'react-json-tree';
import { PerformAction } from '@redux-devtools/core';
import { Delta } from 'jsondiffpatch';
import type { JSX } from '@emotion/react/jsx-runtime';
import { DEFAULT_STATE, DevtoolsInspectorState } from './redux';
import ActionPreviewHeader from './ActionPreviewHeader';
import DiffTab from './tabs/DiffTab';
@ -80,7 +81,7 @@ class ActionPreview<S, A extends Action<string>> extends Component<
tabName: DEFAULT_STATE.tabName,
};
render() {
render(): JSX.Element {
const {
delta,
error,

View File

@ -6,6 +6,7 @@ import { Delta } from 'jsondiffpatch';
import { Base16Theme } from 'redux-devtools-themes';
import { css } from '@emotion/react';
import type { Interpolation, Theme } from '@emotion/react';
import type { JSX } from '@emotion/react/jsx-runtime';
import getItemString from './getItemString';
import getJsonTreeTheme from './getJsonTreeTheme';
@ -91,7 +92,7 @@ export default class JSONDiff extends Component<Props, State> {
this.setState({ data: this.props.delta });
}
render() {
render(): JSX.Element {
const { base16Theme, ...props } = this.props;
if (!this.state.data) {

View File

@ -1,5 +1,6 @@
import React from 'react';
import { isCollection, isIndexed, isKeyed } from 'immutable';
import type { JSX } from '@emotion/react/jsx-runtime';
import isIterable from '../utils/isIterable';
const IS_IMMUTABLE_KEY = '@@__IS_IMMUTABLE__@@';
@ -76,7 +77,7 @@ const getItemString = (
dataTypeKey: string | symbol | undefined,
isWideLayout: boolean,
isDiff?: boolean,
) => (
): JSX.Element => (
<span css={(theme) => ({ color: theme.ITEM_HINT_COLOR })}>
{data[IS_IMMUTABLE_KEY] ? 'Immutable' : ''}
{dataTypeKey && data[dataTypeKey] ? `${data[dataTypeKey] as string} ` : ''}