Skip to content

Commit 41ea59b

Browse files
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 <[email protected]>
1 parent 24f60a7 commit 41ea59b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/redux-devtools-extension/src/utils/assign.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const objectKeys =
88
return keys;
99
};
1010

11-
export default function assign<T, K extends keyof T>(
11+
export default function assign<T extends object, K extends keyof T>(
1212
obj: T,
1313
newKey: K,
1414
newValue: T[K]

packages/redux-devtools-ui/src/Tabs/Tabs.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default {
1818
component: Tabs,
1919
};
2020

21-
const Template: Story<TabsProps<unknown>> = (args) => (
21+
const Template: Story<TabsProps<object>> = (args) => (
2222
<Container>
2323
<Tabs {...args} />
2424
</Container>

packages/redux-devtools-ui/src/Tabs/Tabs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface TabsProps<P> {
1414
position: Position;
1515
}
1616

17-
export default class Tabs<P> extends Component<TabsProps<P>> {
17+
export default class Tabs<P extends object> extends Component<TabsProps<P>> {
1818
SelectedComponent?: React.ComponentType<P>;
1919
selector?: () => P;
2020

0 commit comments

Comments
 (0)