Skip to content

Commit 07b82dd

Browse files
authored
feat: add TS support for readme example (#46)
1 parent fb25d46 commit 07b82dd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

types/mapContextToProps.d.ts

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ declare module '@restart/context/mapContextToProps' {
1717
> {}
1818

1919
// Single Context
20+
function mapContextToProps<TComponent, TContext, TContextProps, TOwnProps>(
21+
data: {
22+
consumers: TContext;
23+
mapToProps: (context: TContext) => TContext,
24+
displayName: string;
25+
},
26+
Component: TComponent,
27+
): ContextInjectedComponent<TComponent, TContextProps, TOwnProps>;
2028
function mapContextToProps<TComponent, TContext, TContextProps, TOwnProps>(
2129
context: React.Context<TContext> | [React.Context<TContext>],
2230
mapToProps: (ctxValue: TContext, props: TOwnProps) => TContextProps,

0 commit comments

Comments
 (0)