Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit d00fced

Browse files
committed
Add basic examples
1 parent fe9af17 commit d00fced

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

docs/.storybook/webpack.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ module.exports = (storybookBaseConfig, configType) => {
2222

2323
storybookBaseConfig.resolve.alias = {
2424
'react-native': 'react-native-web',
25+
'FlatList': path.join(__dirname, '../../src/FlatList'),
26+
'SectionList': path.join(__dirname, '../../src/SectionList'),
2527
};
2628

2729
return storybookBaseConfig;

docs/stories/index.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
import React from 'react';
2-
import YourComponent from 'react-native-web-name'
2+
import { Text } from 'react-native';
3+
import FlatList from 'FlatList';
4+
import SectionList from 'SectionList';
35

46
import { storiesOf } from '@storybook/react';
57

6-
storiesOf('YourComponent', module).add('basic', () => <YourComponent />);
8+
storiesOf('FlatList', module).add('basic', () => (
9+
<FlatList data={[{ key: 'a' }, { key: 'b' }]} renderItem={({ item }) => <Text>{item.key}</Text>} />
10+
));
11+
12+
storiesOf('SectionList', module).add('basic', () => (
13+
<SectionList
14+
renderItem={({ item }) => <Text>Item: {item.key}</Text>}
15+
renderSectionHeader={({ section }) => <Text>Header: {section.title}</Text>}
16+
sections={[{ data: [{ key: 'a' }, { key: 'b' }], title: 'A' }, { data: [{ key: 'c' }, { key: 'd' }], title: 'B' }]}
17+
/>
18+
));

0 commit comments

Comments
 (0)