From 18df77bf0000d5e1083e15522c778b6cddea7b79 Mon Sep 17 00:00:00 2001 From: StoraH Date: Thu, 10 Sep 2015 10:46:19 +0200 Subject: [PATCH 01/13] Make use of states so we can update the counter numbers. --- index.js | 51 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 11 deletions(-) diff --git a/index.js b/index.js index b2d0caa..383ff7b 100644 --- a/index.js +++ b/index.js @@ -4,38 +4,67 @@ var ease = require('ease-component'); var Counter = React.createClass({ getInitialState: function() { - return { value: this.props.begin }; + return { + value: this.props.begin, + time: this.props.time, + begin: this.props.begin, + end: this.props.end, + easing: this.props.easing, + start: Date.now(), + stop: false + }; }, componentDidMount: function() { - this.start = Date.now(); raf(this.animate); }, animate: function() { - if (this.stop) return; + if (this.state.stop) return; raf(this.animate); this.draw() }, + componentWillReceiveProps: function(nextProps) { + this.setState({ + time: nextProps.time, + begin: nextProps.begin, + end: nextProps.end, + easing: nextProps.easing, + start: Date.now(), + stop: false + }); + + raf(this.animate); + this.draw(); + }, + draw: function() { if (!this.isMounted()) return; - var time = this.props.time; - var begin = this.props.begin; - var end = this.props.end; - var easing = this.props.easing; + var time = this.state.time; + var begin = this.state.begin; + var end = this.state.end; + var easing = this.state.easing; easing = easing && easing in ease ? easing : 'outCube'; - var now = Date.now() - if (now - this.start >= time) this.stop = true; - var percentage = (now - this.start) / time; + + var now = Date.now(); + if (now - this.state.start >= time) { + this.setState({ + stop: true + }); + } + + var percentage = (now - this.state.start) / time; percentage = percentage > 1 ? 1 : percentage; var easeVal = ease[easing](percentage); var val = begin + (end - begin) * easeVal; - this.setState({ value: val }); + this.setState({ + value: val + }); }, render: function() { From 48ecdd3ff366816e61f44beb4395055ebae58a58 Mon Sep 17 00:00:00 2001 From: StoraH Date: Thu, 10 Sep 2015 11:02:57 +0200 Subject: [PATCH 02/13] React peer dependency --- package.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 49a1b22..406fd58 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,9 @@ "homepage": "https://github.com/saebekassebil/react-counter", "dependencies": { "ease-component": "^1.0.0", - "raf": "^2.0.4", - "react": "^0.12.2" + "raf": "^2.0.4" + }, + "peerDependencies": { + "react": ">= 0.12" } -} +} \ No newline at end of file From 62f07502c04daae792814af72fef2df61d6ce46d Mon Sep 17 00:00:00 2001 From: Bruno Mota Date: Thu, 8 Oct 2015 16:40:36 +0100 Subject: [PATCH 03/13] react 0.14 support --- index.js | 10 +++++++--- package.json | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index b2d0caa..eedb4cb 100644 --- a/index.js +++ b/index.js @@ -16,7 +16,7 @@ var Counter = React.createClass({ if (this.stop) return; raf(this.animate); - this.draw() + this.draw(); }, draw: function() { @@ -28,7 +28,7 @@ var Counter = React.createClass({ var easing = this.props.easing; easing = easing && easing in ease ? easing : 'outCube'; - var now = Date.now() + var now = Date.now(); if (now - this.start >= time) this.stop = true; var percentage = (now - this.start) / time; percentage = percentage > 1 ? 1 : percentage; @@ -39,7 +39,11 @@ var Counter = React.createClass({ }, render: function() { - return React.DOM.span({ className: 'counter' }, Math.round(this.state.value)); + return ( + + {Math.round(this.state.value)} + + ); } }); diff --git a/package.json b/package.json index d88ae4b..b5afdaf 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,6 @@ "raf": "^2.0.4" }, "peerDependencies": { - "react": ">= 0.12" + "react": "^0.14.0" } } From 15f743fe5eb2ecc62fc2d7481882cd09af029336 Mon Sep 17 00:00:00 2001 From: Bruno Mota Date: Thu, 8 Oct 2015 19:38:59 +0100 Subject: [PATCH 04/13] no jsx fix --- index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/index.js b/index.js index eedb4cb..5c400c9 100644 --- a/index.js +++ b/index.js @@ -39,11 +39,7 @@ var Counter = React.createClass({ }, render: function() { - return ( - - {Math.round(this.state.value)} - - ); + return React.DOM.span({ className: 'counter' }, Math.round(this.state.value)); } }); From 9919751197604a2c5b26b6683764843b6e72b680 Mon Sep 17 00:00:00 2001 From: Nick Hudkins Date: Thu, 5 May 2016 15:45:23 -0400 Subject: [PATCH 05/13] Allow display to be formatted. Some folks may want to display numbers as 1,000 or similar? --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index b2d0caa..080c958 100644 --- a/index.js +++ b/index.js @@ -39,7 +39,8 @@ var Counter = React.createClass({ }, render: function() { - return React.DOM.span({ className: 'counter' }, Math.round(this.state.value)); + var value = this.props.formatFunc ? this.props.formatFunc(this.state.value) : Math.round(this.state.value); + return React.DOM.span({ className: 'counter' }, value); } }); From 7b0d3a787145fc641d054edf9aa628d358816821 Mon Sep 17 00:00:00 2001 From: Oleg Dizus Date: Thu, 30 Jun 2016 20:06:24 +0300 Subject: [PATCH 06/13] Fix: Update value when new props received --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 383ff7b..e334e53 100644 --- a/index.js +++ b/index.js @@ -34,10 +34,10 @@ var Counter = React.createClass({ easing: nextProps.easing, start: Date.now(), stop: false + }, function() { + raf(this.animate); + this.draw(); }); - - raf(this.animate); - this.draw(); }, draw: function() { From da8b349339b960abad45bf8bfc13d71df9ba2d96 Mon Sep 17 00:00:00 2001 From: Rasmus Eneman Date: Tue, 30 Aug 2016 11:04:42 +0200 Subject: [PATCH 07/13] fix: React 15 support --- .gitignore | 1 + index.js | 8 ++++++-- package.json | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/index.js b/index.js index 5fe180e..728cc3e 100644 --- a/index.js +++ b/index.js @@ -69,8 +69,12 @@ var Counter = React.createClass({ render: function() { var value = this.props.formatFunc ? this.props.formatFunc(this.state.value) : Math.round(this.state.value); - return React.DOM.span({ className: 'counter' }, value); + return React.createElement( + 'span', + { className: 'counter' }, + value + ); } }); -module.exports = Counter; +module.exports.Counter = Counter; diff --git a/package.json b/package.json index 636e77f..0bc2ac5 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,6 @@ "raf": "^2.0.4" }, "peerDependencies": { - "react": "^0.14.0" + "react": "^15.0.0" } } \ No newline at end of file From 3b098d80de1e9f8498bba8d930c1502e9080f580 Mon Sep 17 00:00:00 2001 From: Rasmus Eneman Date: Tue, 30 Aug 2016 11:09:57 +0200 Subject: [PATCH 08/13] publish on npm --- README.md | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 94f49ad..aba842b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A dead-simple incremental counter component with easing animations. - npm install react-counter + npm install @beanloop-ab/react-counter ```js var React = require('react'); diff --git a/package.json b/package.json index 0bc2ac5..85b3cfc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "react-counter", - "version": "1.1.0", + "name": "@beanloop-ab/react-counter", + "version": "1.2.0", "description": "Simple incremental counter with easings", "main": "index.js", "repository": { From f36d7efd54a23cc0688412c1d106f51fecc8a942 Mon Sep 17 00:00:00 2001 From: rassek96 Date: Thu, 9 Aug 2018 14:53:17 +0200 Subject: [PATCH 09/13] fix: substituted old isMounted and React.createClass --- index.js | 14 +++-- package-lock.json | 127 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 3 +- yarn.lock | 111 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 251 insertions(+), 4 deletions(-) create mode 100644 package-lock.json create mode 100644 yarn.lock diff --git a/index.js b/index.js index 728cc3e..a33407d 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,9 @@ var React = require('react'); var raf = require('raf'); var ease = require('ease-component'); -var Counter = React.createClass({ + +var createClass = require('create-react-class'); +var Counter = createClass({ getInitialState: function() { return { value: this.props.begin, @@ -11,14 +13,20 @@ var Counter = React.createClass({ end: this.props.end, easing: this.props.easing, start: Date.now(), - stop: false + stop: false, + mounted: false }; }, componentDidMount: function() { + this.mounted = true; raf(this.animate); }, + componentWillUnmount: function() { + this.mounted = false; + }, + animate: function() { if (this.state.stop) return; @@ -41,7 +49,7 @@ var Counter = React.createClass({ }, draw: function() { - if (!this.isMounted()) return; + if (!this.mounted) return; var time = this.state.time; var begin = this.state.begin; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..bd50fac --- /dev/null +++ b/package-lock.json @@ -0,0 +1,127 @@ +{ + "name": "@beanloop-ab/react-counter", + "version": "1.2.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" + }, + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" + }, + "create-react-class": { + "version": "15.6.3", + "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.6.3.tgz", + "integrity": "sha512-M+/3Q6E6DLO6Yx3OwrWjwHBnvfXXYA7W+dFjt/ZDBemHO1DDZhsalX/NUtnTYclN6GfnBDRh4qRHjcDHmlJBJg==", + "requires": { + "fbjs": "0.8.17", + "loose-envify": "1.3.1", + "object-assign": "4.1.1" + } + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "requires": { + "iconv-lite": "0.4.23" + } + }, + "fbjs": { + "version": "0.8.17", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.17.tgz", + "integrity": "sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=", + "requires": { + "core-js": "1.2.7", + "isomorphic-fetch": "2.2.1", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "promise": "7.3.1", + "setimmediate": "1.0.5", + "ua-parser-js": "0.7.18" + } + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "requires": { + "safer-buffer": "2.1.2" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "requires": { + "node-fetch": "1.7.3", + "whatwg-fetch": "2.0.4" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "requires": { + "js-tokens": "3.0.2" + } + }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "requires": { + "encoding": "0.1.12", + "is-stream": "1.1.0" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "requires": { + "asap": "2.0.6" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "ua-parser-js": { + "version": "0.7.18", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.18.tgz", + "integrity": "sha512-LtzwHlVHwFGTptfNSgezHp7WUlwiqb0gA9AALRbKaERfxwJoiX0A73QbTToxteIAuIaFshhgIZfqK8s7clqgnA==" + }, + "whatwg-fetch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", + "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" + } + } +} diff --git a/package.json b/package.json index 85b3cfc..df14758 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@beanloop-ab/react-counter", - "version": "1.2.0", + "version": "2.0.1", "description": "Simple incremental counter with easings", "main": "index.js", "repository": { @@ -20,6 +20,7 @@ }, "homepage": "https://github.com/saebekassebil/react-counter", "dependencies": { + "create-react-class": "^15.6.3", "ease-component": "^1.0.0", "raf": "^2.0.4" }, diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..ea583f2 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,111 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +asap@~2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + +core-js@^1.0.0: + version "1.2.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" + +create-react-class@^15.6.3: + version "15.6.3" + resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.6.3.tgz#2d73237fb3f970ae6ebe011a9e66f46dbca80036" + dependencies: + fbjs "^0.8.9" + loose-envify "^1.3.1" + object-assign "^4.1.1" + +ease-component@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ease-component/-/ease-component-1.0.0.tgz#b375726db0b5b04595b77440396fec7daa5d77c9" + +encoding@^0.1.11: + version "0.1.12" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + dependencies: + iconv-lite "~0.4.13" + +fbjs@^0.8.9: + version "0.8.17" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" + dependencies: + core-js "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.18" + +iconv-lite@~0.4.13: + version "0.4.23" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" + dependencies: + safer-buffer ">= 2.1.2 < 3" + +is-stream@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +isomorphic-fetch@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" + dependencies: + node-fetch "^1.0.1" + whatwg-fetch ">=0.10.0" + +js-tokens@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + +loose-envify@^1.0.0, loose-envify@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" + dependencies: + js-tokens "^3.0.0" + +node-fetch@^1.0.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +performance-now@~0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.1.4.tgz#360b642f073ff8c2a693b3c38d7ccbc17b53183b" + +promise@^7.1.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" + dependencies: + asap "~2.0.3" + +raf@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/raf/-/raf-2.0.4.tgz#4993e453ea5275bf6ef07a163bdfe9a23233b623" + dependencies: + performance-now "~0.1.3" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + +ua-parser-js@^0.7.18: + version "0.7.18" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.18.tgz#a7bfd92f56edfb117083b69e31d2aa8882d4b1ed" + +whatwg-fetch@>=0.10.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" From 516cb7e4c5ec6ce85543762745be56b175d256ad Mon Sep 17 00:00:00 2001 From: Oscar Nordquist Date: Wed, 17 Oct 2018 14:35:07 +0200 Subject: [PATCH 10/13] mounted -> isMounted --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index a33407d..7fd6bea 100644 --- a/index.js +++ b/index.js @@ -49,7 +49,7 @@ var Counter = createClass({ }, draw: function() { - if (!this.mounted) return; + if (!this.isMounted) return; var time = this.state.time; var begin = this.state.begin; From f612857c8ac376fc38d681eeff7fd315ae56031d Mon Sep 17 00:00:00 2001 From: Oscar Nordquist Date: Wed, 17 Oct 2018 14:35:25 +0200 Subject: [PATCH 11/13] mounted -> isMounted --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 7fd6bea..db09db5 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ var Counter = createClass({ }, componentDidMount: function() { - this.mounted = true; + this.isMounted = true; raf(this.animate); }, From b364d9e43cf3df6db51d2be4107ade33e6fec669 Mon Sep 17 00:00:00 2001 From: Oscar Nordquist Date: Wed, 17 Oct 2018 14:35:28 +0200 Subject: [PATCH 12/13] mounted -> isMounted --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index db09db5..3b96cf4 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ var Counter = createClass({ easing: this.props.easing, start: Date.now(), stop: false, - mounted: false + isMounted: false }; }, From 1f46a7254d19882c9e1b7a40808f7fd3c804e231 Mon Sep 17 00:00:00 2001 From: Oscar Nordquist Date: Wed, 17 Oct 2018 14:35:30 +0200 Subject: [PATCH 13/13] mounted -> isMounted --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 3b96cf4..8fc235b 100644 --- a/index.js +++ b/index.js @@ -24,7 +24,7 @@ var Counter = createClass({ }, componentWillUnmount: function() { - this.mounted = false; + this.isMounted = false; }, animate: function() {