mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-04-26 03:03:42 +03:00
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 <nbierema@gmail.com>
This commit is contained in:
parent
24f60a7aa7
commit
41ea59b42e
|
@ -8,7 +8,7 @@ const objectKeys =
|
||||||
return keys;
|
return keys;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function assign<T, K extends keyof T>(
|
export default function assign<T extends object, K extends keyof T>(
|
||||||
obj: T,
|
obj: T,
|
||||||
newKey: K,
|
newKey: K,
|
||||||
newValue: T[K]
|
newValue: T[K]
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default {
|
||||||
component: Tabs,
|
component: Tabs,
|
||||||
};
|
};
|
||||||
|
|
||||||
const Template: Story<TabsProps<unknown>> = (args) => (
|
const Template: Story<TabsProps<object>> = (args) => (
|
||||||
<Container>
|
<Container>
|
||||||
<Tabs {...args} />
|
<Tabs {...args} />
|
||||||
</Container>
|
</Container>
|
||||||
|
|
|
@ -14,7 +14,7 @@ export interface TabsProps<P> {
|
||||||
position: Position;
|
position: Position;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Tabs<P> extends Component<TabsProps<P>> {
|
export default class Tabs<P extends object> extends Component<TabsProps<P>> {
|
||||||
SelectedComponent?: React.ComponentType<P>;
|
SelectedComponent?: React.ComponentType<P>;
|
||||||
selector?: () => P;
|
selector?: () => P;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user