Skip to content

Commit

Permalink
fix: update render next
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Oct 29, 2020
1 parent b6ba32f commit 28946b5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions core/render/src/react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,17 @@ export const render: FrameworkRenderFn = (story, doc, options: any = {}) => {
globalDecorators,
storyDecorators,
);

const sortedDecorators = decorators.reverse();
let renderFn = story.renderFn;
for (let i = 0; i < sortedDecorators.length; i += 1) {
const decorator = sortedDecorators[i];
const childFn = renderFn;
const nextFn = (_: any, nexContext: any) =>
const nextRenderFn = (_: any, nexContext: any) =>
(childFn as StoryRenderFn)(values, { ...context, ...nexContext });
renderFn = () =>
decorator(nextFn, {
decorator(nextRenderFn, {
...context,
renderFn: nextFn,
renderFn: nextRenderFn,
});
}
let node: any = null;
Expand Down

0 comments on commit 28946b5

Please sign in to comment.