Skip to content

Commit 70f7ca3

Browse files
committed
refactor!: rename passProperties -> commonProperties
1 parent 71c8f85 commit 70f7ca3

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const Foo = ({ name, commonProp1 }) => (
2828
// Common properties shared among all
2929
// the children e.g. state, dispatch
3030
// and callback functions like onClick
31-
passProperties={{
31+
commonProperties={{
3232
commonProp1: "commonProp1",
3333
}}
3434

src/index.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from "react";
22

3-
const wrapComponentProperties = (passProperties, Component, keyFunction) => (
3+
const wrapComponentProperties = (commonProperties, Component, keyFunction) => (
44
props,
55
index,
66
) => (
7-
<Component key={keyFunction(props, index)} mappingIndex={index} {...props} {...passProperties} />
7+
<Component key={keyFunction(props, index)} mappingIndex={index} {...props} {...commonProperties} />
88
);
99

10-
const ComponentMap = ({ data, component, passProperties, keyFunction }) =>
11-
data.map(wrapComponentProperties(passProperties, component, keyFunction));
10+
const ComponentMap = ({ data, component, commonProperties, keyFunction }) =>
11+
data.map(wrapComponentProperties(commonProperties, component, keyFunction));
1212

1313
export default ComponentMap;

src/stories/ComponentMap.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Primary.args = {
2323
{ id: 1, name: "hello" },
2424
{ id: 2, name: "world" },
2525
],
26-
passProperties: {
26+
commonProperties: {
2727
commonProp1: "commonProp1",
2828
},
2929
keyFunction: (props, index) => {

0 commit comments

Comments
 (0)