Skip to content

Commit 85c0db8

Browse files
Use Show from effector to enforce better types in IDE
1 parent 57d6f3f commit 85c0db8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

public-types/reflect.d.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable @typescript-eslint/consistent-type-definitions */
2-
import type { EventCallable, Store } from 'effector';
2+
import type { EventCallable, Show, Store } from 'effector';
33
import type { useUnit } from 'effector-react';
44
import type { ComponentType, FC, PropsWithChildren, ReactHTML } from 'react';
55

@@ -37,12 +37,11 @@ type BindFromProps<Props> = {
3737
* Props that are "taken" by Bind object are made **optional** in the final type,
3838
* so it is possible to owerrite them in the component usage anyway
3939
*/
40-
type FinalProps<Props, Bind extends BindFromProps<Props>> = Omit<
41-
Props,
42-
keyof Bind
43-
> & {
44-
[K in Extract<keyof Bind, keyof Props>]?: Props[K];
45-
};
40+
type FinalProps<Props, Bind extends BindFromProps<Props>> = Show<
41+
Omit<Props, keyof Bind> & {
42+
[K in Extract<keyof Bind, keyof Props>]?: Props[K];
43+
}
44+
>;
4645

4746
// relfect types
4847
/**

0 commit comments

Comments
 (0)