Skip to content

Commit 6b87e5c

Browse files
committed
Merge pull request #3 from drd/master
Update asyncInput to work with modern React
2 parents c1de10d + 3f037d5 commit 6b87e5c

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

index.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ function asyncInput (ctor) {
2121
},
2222

2323
render: function () {
24-
return this.transferPropsTo(
25-
ctor({
24+
return React.createElement(
25+
ctor,
26+
React.__spread({}, this.props, {
2627
value: this.state.value,
27-
onChange: this.onChange,
28-
children: this.props.children
29-
})
28+
onChange: this.onChange
29+
}),
30+
this.props.children
3031
)
3132
}
3233
})

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "0.9.0",
44
"description": "wrap React inputs so that asynchrous updates don't cause the cursor to jump",
55
"main": "index.js",
6-
"dependencies": {
7-
"react": "~0.9.0"
6+
"peerDependencies": {
7+
"react": ">=0.12.0"
88
},
99
"devDependencies": {
1010
"tape": "~2.3.2"

0 commit comments

Comments
 (0)