zillow / react-slider

Accessible, CSS agnostic, slider component for React.
https://zillow.github.io/react-slider
MIT License
891 stars 232 forks source link

Use of Legacy String Ref API #98

Closed Mike-Bell closed 6 years ago

Mike-Bell commented 7 years ago

Code has 2 uses of this.refs and the "legacy string ref API"

ref: 'slider'
ref: 'handle' + i

var slider = this.refs.slider;
var handle = this.refs.handle0;

According to relevant React docs, "string refs have some issues, are considered legacy, and are likely to be removed in one of the future releases".

not-mike-smith commented 6 years ago

I saw this and it caused the code not to work in my environment. I read through the link you posted and changed the code in a fork. I'm new to both open source and front end coding, but my fix is available here for review

Mike-Bell commented 6 years ago

that looks about right to me. Are you using React 16? wonder if they finally remove string refs there.

not-mike-smith commented 6 years ago

I'm using React 15.6.2, actually. Should I make a pull request? Thanks