From 41ea59b42e66ae4f8fb99788ef7d556a44ad3a94 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 19 Jul 2022 17:25:45 -0700 Subject: [PATCH] Provide explicit constraints for TypeScript 4.8 (#1201) * Add `extends object` constraint to `T` in `assign` helper. * Add `JSX.IntrinsictAttributes` constraint to `P` in `Tabs`. * Format Co-authored-by: Nathan Bierema --- packages/redux-devtools-extension/src/utils/assign.ts | 2 +- packages/redux-devtools-ui/src/Tabs/Tabs.stories.tsx | 2 +- packages/redux-devtools-ui/src/Tabs/Tabs.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/redux-devtools-extension/src/utils/assign.ts b/packages/redux-devtools-extension/src/utils/assign.ts index b9588369..c0a193ef 100644 --- a/packages/redux-devtools-extension/src/utils/assign.ts +++ b/packages/redux-devtools-extension/src/utils/assign.ts @@ -8,7 +8,7 @@ const objectKeys = return keys; }; -export default function assign( +export default function assign( obj: T, newKey: K, newValue: T[K] diff --git a/packages/redux-devtools-ui/src/Tabs/Tabs.stories.tsx b/packages/redux-devtools-ui/src/Tabs/Tabs.stories.tsx index 7598992a..2ef8e78c 100644 --- a/packages/redux-devtools-ui/src/Tabs/Tabs.stories.tsx +++ b/packages/redux-devtools-ui/src/Tabs/Tabs.stories.tsx @@ -18,7 +18,7 @@ export default { component: Tabs, }; -const Template: Story> = (args) => ( +const Template: Story> = (args) => ( diff --git a/packages/redux-devtools-ui/src/Tabs/Tabs.tsx b/packages/redux-devtools-ui/src/Tabs/Tabs.tsx index c47351d5..2aaae2df 100644 --- a/packages/redux-devtools-ui/src/Tabs/Tabs.tsx +++ b/packages/redux-devtools-ui/src/Tabs/Tabs.tsx @@ -14,7 +14,7 @@ export interface TabsProps

{ position: Position; } -export default class Tabs

extends Component> { +export default class Tabs

extends Component> { SelectedComponent?: React.ComponentType

; selector?: () => P;