Skip to content

Instantly share code, notes, and snippets.

View Under-Warz's full-sized avatar

Laurent Menu Under-Warz

View GitHub Profile
@Under-Warz
Under-Warz / containerProps.ts
Created January 27, 2022 13:27
create ContainerProps type
/**
* Type that allows us to type component containers
* InjectedProps: The props injected by the container in the child component
* NeededProps: The Props the container needs that are not in the child component
*
* The InjectedProps object needs to be a subset of the ChildProps keys.
*/
export type ContainerProps<
ChildProps,
InjectedKeys extends keyof Partial<ChildProps>,