Pass component when rendering inline

For #16147
This commit is contained in:
Tom Coleman 2021-09-24 11:43:15 +10:00
parent a7ba16a096
commit 5683c4baae
2 changed files with 3 additions and 2 deletions

View File

@ -13,7 +13,7 @@ const limit = pLimit(1);
*/
export const prepareForInline = (
storyFn: PartialStoryFn<AngularFramework>,
{ id, parameters }: StoryContext
{ id, parameters, component }: StoryContext
) => {
return React.createElement('div', {
ref: async (node?: HTMLDivElement): Promise<void> => {
@ -25,6 +25,7 @@ export const prepareForInline = (
const renderer = await rendererFactory.getRendererInstance(`${id}-${nanoid(10)}`, node);
await renderer.render({
forced: false,
component,
parameters,
storyFnAngular: storyFn(),
targetDOMNode: node,

View File

@ -104,7 +104,7 @@ export abstract class AbstractRenderer {
}: {
storyFnAngular: StoryFnAngularReturnType;
forced: boolean;
component?: any;
component: any;
parameters: Parameters;
targetDOMNode: HTMLElement;
}) {