mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Prevent creation of dynamic components where withInjectables use type parameters to make React not re-mount because of dynamic components being different (#4808)
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
6ebfd76644
commit
09824a6e01
@ -138,13 +138,10 @@ class NonInjectedKubeObjectListLayout<K extends KubeObject> extends React.Compon
|
||||
}
|
||||
}
|
||||
|
||||
export function KubeObjectListLayout<K extends KubeObject>(
|
||||
props: KubeObjectListLayoutProps<K>,
|
||||
) {
|
||||
const InjectedKubeObjectListLayout = withInjectables<
|
||||
const InjectedKubeObjectListLayout = withInjectables<
|
||||
Dependencies,
|
||||
KubeObjectListLayoutProps<K>
|
||||
>(
|
||||
KubeObjectListLayoutProps<KubeObject>
|
||||
>(
|
||||
NonInjectedKubeObjectListLayout,
|
||||
|
||||
{
|
||||
@ -154,7 +151,12 @@ export function KubeObjectListLayout<K extends KubeObject>(
|
||||
...props,
|
||||
}),
|
||||
},
|
||||
);
|
||||
);
|
||||
|
||||
|
||||
export function KubeObjectListLayout<K extends KubeObject>(
|
||||
props: KubeObjectListLayoutProps<K>,
|
||||
) {
|
||||
|
||||
return <InjectedKubeObjectListLayout {...props} />;
|
||||
}
|
||||
|
||||
@ -108,10 +108,7 @@ class NonInjectedKubeObjectMenu<TKubeObject extends KubeObject> extends React.Co
|
||||
}
|
||||
}
|
||||
|
||||
export function KubeObjectMenu<T extends KubeObject>(
|
||||
props: KubeObjectMenuProps<T>,
|
||||
) {
|
||||
const InjectedKubeObjectMenu = withInjectables<Dependencies, KubeObjectMenuProps<T>>(
|
||||
const InjectedKubeObjectMenu = withInjectables<Dependencies, KubeObjectMenuProps<KubeObject>>(
|
||||
NonInjectedKubeObjectMenu,
|
||||
{
|
||||
getProps: (di, props) => ({
|
||||
@ -126,7 +123,10 @@ export function KubeObjectMenu<T extends KubeObject>(
|
||||
...props,
|
||||
}),
|
||||
},
|
||||
);
|
||||
);
|
||||
|
||||
export function KubeObjectMenu<T extends KubeObject>(
|
||||
props: KubeObjectMenuProps<T>,
|
||||
) {
|
||||
return <InjectedKubeObjectMenu {...props} />;
|
||||
}
|
||||
|
||||
@ -246,8 +246,7 @@ class NonInjectedTable<Item> extends React.Component<TableProps<Item> & Dependen
|
||||
}
|
||||
}
|
||||
|
||||
export function Table<Item>(props: TableProps<Item>) {
|
||||
const InjectedTable = withInjectables<Dependencies, TableProps<Item>>(
|
||||
const InjectedTable = withInjectables<Dependencies, TableProps<any>>(
|
||||
NonInjectedTable,
|
||||
|
||||
{
|
||||
@ -256,8 +255,9 @@ export function Table<Item>(props: TableProps<Item>) {
|
||||
...props,
|
||||
}),
|
||||
},
|
||||
);
|
||||
);
|
||||
|
||||
export function Table<Item>(props: TableProps<Item>) {
|
||||
return <InjectedTable {...props} />;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user