Skip to content

Commit 0debc32

Browse files
committed
Merge pull request #36 from vslinko/patch-3
Allow to transform container props based on component props
2 parents a28fb75 + 82bd104 commit 0debc32

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/addons/container.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React from 'react';
22
import Container from '../Container';
33
import getDisplayName from './getDisplayName';
44

5-
function defaultTransformProps({ state, actions }) {
6-
return { ...state, ...actions };
5+
function defaultTransformProps({ props, state, actions }) {
6+
return { ...props, ...state, ...actions };
77
}
88

99
export default function container(
@@ -14,10 +14,11 @@ export default function container(
1414
static displayName = `ReduxContainer(${getDisplayName(DecoratedComponent)})`;
1515

1616
render() {
17+
const {props} = this
18+
1719
return (
1820
<Container actions={actions} stores={stores}>
19-
{props => <DecoratedComponent {...this.props}
20-
{...transformProps(props)} />}
21+
{({state, actions}) => <DecoratedComponent {...transformProps({props, state, actions})} />}
2122
</Container>
2223
);
2324
}

0 commit comments

Comments
 (0)