Skip to content

Commit

Permalink
fix: sb6 docs compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Oct 14, 2020
1 parent f37b1ba commit 8d3a767
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/stories/src/stories/stories-async.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ hooksStory.description =
hooksStory.decorators = [
(controls, context) => {
const { renderFn } = context;
const story = typeof renderFn === 'function' ? renderFn : controls;
return (
<div style={{ background: 'lightblue' }}>
{renderFn(controls, context)}
</div>
<div style={{ background: 'lightblue' }}>{story(controls, context)}</div>
);
},
];
Expand All @@ -58,11 +57,11 @@ asyncDecorators.description =
asyncDecorators.decorators = [
(controls, context) => {
const { value } = useAsync(fetchData);

const { renderFn } = context;
const story = typeof renderFn === 'function' ? renderFn : controls;
return (
<div style={{ background: 'lightpink' }}>
{renderFn(controls, { ...context, employee: value })}
{story(controls, { ...context, employee: value })}
</div>
);
},
Expand All @@ -85,9 +84,10 @@ asyncHooksDecorators.decorators = [
}, []);

const { renderFn } = context;
const story = typeof renderFn === 'function' ? renderFn : controls;
return (
<div style={{ background: 'lightpink' }}>
{renderFn(controls, { ...context, employee })}
{story(controls, { ...context, employee })}
</div>
);
},
Expand Down

0 comments on commit 8d3a767

Please sign in to comment.