Skip to content

Commit 91a72a2

Browse files
committed
rm jsx
1 parent c35f6f8 commit 91a72a2

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

lib/react-most.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const CONTEXT_TYPE = {
1616
[MERGE_OBSERVE]: React.PropTypes.func,
1717
};
1818

19+
const h = React.createElement;
1920
export function connect(main, opts = {}) {
2021
return function(WrappedComponent) {
2122
let connectDisplayName = `Connect(${getDisplayName(WrappedComponent)})`;
@@ -31,13 +32,12 @@ export function connect(main, opts = {}) {
3132
this.actions = mergeAll([actions, props.actions]);
3233
}
3334
render() {
34-
return (
35-
<WrappedComponent
36-
{...this.props}
37-
{...opts}
38-
sink$={this.sink$}
39-
actions={this.actions}
40-
/>
35+
return h(
36+
WrappedComponent,
37+
Object.assign({}, this.props, opts, {
38+
sink$: this.sink$,
39+
actions: this.actions,
40+
})
4141
);
4242
}
4343
}
@@ -98,13 +98,11 @@ export function connect(main, opts = {}) {
9898
this.subscriptions.unsubscribe();
9999
}
100100
render() {
101-
return (
102-
<WrappedComponent
103-
{...this.props}
104-
{...this.state}
105-
{...opts}
106-
actions={this.actions}
107-
/>
101+
return h(
102+
WrappedComponent,
103+
Object.assign({}, this.props, this.state, opts, {
104+
actions: this.actions,
105+
})
108106
);
109107
}
110108
}

0 commit comments

Comments
 (0)