-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.js
35 lines (31 loc) · 868 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from 'react';
import { storiesOf } from '@kadira/storybook';
import { Post1, Post2, Post3, CommentListContainer3 } from './components';
import { stub } from '../';
const stories = storiesOf('React Stubber', module);
stories.add('without stub', () => (
<Post1
id="the-id"
title="Stubbing React Containers"
text="This is not something hard. Let's see how to do it."
/>
));
stories.add('with default stub', () => (
<Post2
id="the-id"
title="Stubbing React Containers"
text="This is not something hard. Let's see how to do it."
/>
));
stories.add('with custom stub', () => {
stub(CommentListContainer3, (props) => (
<div>Comments for postId: {props.postId}</div>
));
return (
<Post3
id="the-id"
title="Stubbing for React Storybook."
text="We can use react-stubber for that."
/>
);
});