From beb0ee65e850ad0460ed10b25bf88725c6ac346c Mon Sep 17 00:00:00 2001 From: Nathan Hunzaker Date: Tue, 29 May 2018 08:36:01 -0400 Subject: [PATCH] Replace legacy string ref, allow className to be overriden --- CHANGELOG.md | 1 + src/index.js | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16b11bc..734180b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## 6.3.0 - Replace legacy string refs +- Allow className to be overriden ## 6.2.0 diff --git a/src/index.js b/src/index.js index 249048e..e066eb6 100644 --- a/src/index.js +++ b/src/index.js @@ -16,6 +16,7 @@ let Equations = require('./util/equations') class Ink extends React.PureComponent { static defaultProps = { background: true, + className: 'ink', duration: 1000, opacity: 0.25, radius: 150, @@ -98,7 +99,7 @@ class Ink extends React.PureComponent { } pushBlot(timeStamp, clientX, clientY) { - let el = this.refs.canvas + let el = this.canvas // 0.13 support if (el instanceof window.HTMLCanvasElement === false) { @@ -126,13 +127,17 @@ class Ink extends React.PureComponent { }) } + setCanvas(el) { + this.canvas = el + } + render() { - let { density, height, width, touchEvents } = this.state + let { className, density, height, width, touchEvents } = this.state return (