Skip to content

Commit d1d443d

Browse files
committed
Use createElement and Object.assign to merge the socket context into the props
1 parent ba1c593 commit d1d443d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/socket-connect.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React, { createFactory, PropTypes } from 'react';
1+
import React, { createElement, PropTypes } from 'react';
22

33
function socketConnect(Target) {
44
function SocketConnect(props, context) {
5-
props.socket = context.socket;
6-
7-
return createFactory(Target)(props);
5+
return createElement(Target, Object.assign({}, props, {
6+
socket: context.socket,
7+
});
88
}
99

1010
SocketConnect.contextTypes = {

0 commit comments

Comments
 (0)