mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-22 09:36:43 +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;
|
||||
};
|
||||
|
||||
export default function assign<T, K extends keyof T>(
|
||||
export default function assign<T extends object, K extends keyof T>(
|
||||
obj: T,
|
||||
newKey: K,
|
||||
newValue: T[K]
|
||||
|
|
|
@ -18,7 +18,7 @@ export default {
|
|||
component: Tabs,
|
||||
};
|
||||
|
||||
const Template: Story<TabsProps<unknown>> = (args) => (
|
||||
const Template: Story<TabsProps<object>> = (args) => (
|
||||
<Container>
|
||||
<Tabs {...args} />
|
||||
</Container>
|
||||
|
|
|
@ -14,7 +14,7 @@ export interface TabsProps<P> {
|
|||
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>;
|
||||
selector?: () => P;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user