react-stepzilla icon indicating copy to clipboard operation
react-stepzilla copied to clipboard

React ref does not work as intended

Open kaiomagalhaes opened this issue 8 years ago • 1 comments

Working with this library I faced an weird issue in which it was not properly defining the ref. It happened because react changed how to work with the refs: https://reactjs.org/docs/refs-and-the-dom.html

In my fork I changed the src/main.js line from:

cloneExtensions.ref = 'activeComponent';

to:

cloneExtensions.ref = (el) => { this.activeComponent = el; };

I had to change how we were validating the activeComponent property in a few places, but then it worked just fine.

I can create a proper pull request for it if you guys want to.

kaiomagalhaes avatar Oct 25 '17 00:10 kaiomagalhaes

how things go on? @kaiomagalhaes

sivagao avatar Feb 02 '18 06:02 sivagao