Skip to content

Commit 6260ad6

Browse files
committed
Fix issue #12 - function custom props.
1 parent 06c787b commit 6260ad6

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "presets": ["es2015", "react"] }
1+
{ "presets": ["es2015", "react", "stage-3"] }

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-currency-input",
3-
"version": "1.2.3",
3+
"version": "1.2.4",
44
"description": "React component for inputing currency amounts",
55
"main": "lib/index.js",
66
"scripts": {
@@ -38,6 +38,7 @@
3838
"babel-cli": "^6.18.0",
3939
"babel-preset-es2015": "^6.9.0",
4040
"babel-preset-react": "^6.5.0",
41+
"babel-preset-stage-3": "6.22.0",
4142
"babel-register": "^6.9.0",
4243
"babelify": "^7.3.0",
4344
"browserify": "^13.0.1",

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const CurrencyInput = React.createClass({
4949
* @returns {{ maskedValue: {String}, value: {Number}, customProps: {Object} }}
5050
*/
5151
prepareProps(props) {
52-
let customProps = JSON.parse(JSON.stringify(props)); //not as clean, but better support
52+
let customProps = {...props}; // babeljs converts to Object.assign, then polyfills.
5353
delete customProps.onChange;
5454
delete customProps.value;
5555
delete customProps.decimalSeparator;

0 commit comments

Comments
 (0)