Skip to content

Commit c9023c2

Browse files
authored
fix: typing for template props data context (#2754)
makes MgtTemplateProps generic to define the type for dataContext with a default of any type this provides backwards compatability and allows for specific typing of templates.
1 parent 239bfb0 commit c9023c2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/mgt-react/src/MgtTemplateProps.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
* -------------------------------------------------------------------------------------------
66
*/
77

8-
export interface MgtTemplateProps {
8+
// Make type generic with a default of any to provide backwards compatibility and allow correct typing of the dataContext
9+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
10+
export interface MgtTemplateProps<T = any> {
911
template?: string;
10-
dataContext?: unknown;
12+
dataContext?: T;
1113
}

0 commit comments

Comments
 (0)