Skip to content

Commit

Permalink
fix: nextfn for renderFn parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Oct 29, 2020
1 parent 070b83d commit 68b53cd
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions core/render/src/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ export const render: FrameworkRenderFn = (story, doc, options: any = {}) => {
for (let i = 0; i < sortedDecorators.length; i += 1) {
const decorator = sortedDecorators[i];
const childFn = renderFn;
const nextFn = (_: any, nexContext: any) =>
(childFn as StoryRenderFn)(values, { ...context, ...nexContext });
renderFn = () =>
decorator(
(_: any, nexContext: any) =>
(childFn as StoryRenderFn)(values, { ...context, ...nexContext }),
{
...context,
renderFn: childFn,
},
);
decorator(nextFn, {
...context,
renderFn: nextFn,
});
}
let node: any = null;
node = () => (renderFn as StoryRenderFn)(values, context);
Expand Down

0 comments on commit 68b53cd

Please sign in to comment.