Skip to content

Commit 411b5cd

Browse files
committed
docs: add some documentation
1 parent dd276f4 commit 411b5cd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,23 @@ const Foo = ({ name, commonProp1 }) => (
1818
);
1919

2020
<ComponentMap
21+
// Component that should be mapped
2122
component={Foo}
23+
24+
// Array with properties for each
25+
// mapped child
2226
data={[{ name: "hello" }, { name: "world" }]}
27+
28+
// Common properties shared among all
29+
// the children e.g. state, dispatch
30+
// and callback functions like onClick
2331
passProperties={{
2432
commonProp1: "commonProp1",
2533
}}
34+
35+
// Each react child should have a unique
36+
// key prop
37+
keyFunction={(props, index) => props.name}
2638
/>
2739

2840
```

0 commit comments

Comments
 (0)