Closed kgram closed 6 years ago
Ahh that's what the problem was with that function -- great catch @kgram !!
That change would not be backward compatible (would require a major release as per semver), but I believe that would be most optimal, especially as that would make it easier for anyone passing in a dotSize
function as a prop to just use arguments.
Any update on this ?
+1
resolved by #8
Clicking the canvas without dragging throws an error. I believe this to be caused by this line. The default value for
dotSize
is defined as an arrow-function, usingthis
to accessprops
. However, the function is defined staticly, which means there is nothis
to speak of. Babel transforms the line toreturn ((void 0).props.minWidth + (void 0).props.maxWidth) / 2
The result is
Uncaught TypeError: Cannot read property 'props' of undefined
.There is a pull request attempting to fix this, but unfortunately it basically just hardcodes the default
dotSize
to2
.Perhaps passing the
minWidth
andmaxWidth
to thedotSize
-function could be a solution?