Skip to content

Commit

Permalink
provide event in props
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippe Lefevre committed Sep 20, 2021
1 parent d79ff45 commit f879785
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface Props {
exportPath: string;
basename?: string;
language?: string;
event?: { [key: string]: any };
arguments?: any;
eventHandlers?: { [id: string]: (...args: Array<any>) => Promise<any> };
loaded?: (el: HTMLElement) => any;
Expand All @@ -25,6 +26,7 @@ export function ReactSRMWrapper({
exportPath,
basename,
language,
event,
arguments: renderArguments,
eventHandlers,
loaded,
Expand Down Expand Up @@ -70,6 +72,7 @@ export function ReactSRMWrapper({
element: anchorEl.current,
basename: basename,
language: language,
event: event,
navigate: (commands: any[], _options: any) => history.push(urljoin(commands)),
sendEvent: (id: string, ...args: Array<any>) => eventHandlers?.[id]?.(...args),
...renderArguments,
Expand Down

0 comments on commit f879785

Please sign in to comment.