Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed old syntax for React refs for React 16 support #131

Merged
merged 1 commit into from
Mar 25, 2018

Conversation

snaerth
Copy link
Contributor

@snaerth snaerth commented Mar 16, 2018

In React 16 there is a new syntax for accessing element through native React refs.

Set component ref

Old syntax: ref="slider"
New syntax: ref={r = (this.slider = r)}

Access ref within class

Old syntax: this.refs.slider
New syntax: this.slider

https://reactjs.org/docs/refs-and-the-dom.html

@axelg12 axelg12 mentioned this pull request Mar 19, 2018
@axelg12
Copy link

axelg12 commented Mar 19, 2018

This fixes #120 and I don't see any reason for not merging this. Any thoughts @mpowaga ?

@snaerth
Copy link
Contributor Author

snaerth commented Mar 23, 2018

@mpowaga Could you a least tell us if you are willing to use this PR

@mpowaga mpowaga merged commit 1a4ba39 into zillow:master Mar 25, 2018
@johnste
Copy link

johnste commented Mar 29, 2018

The fat arrow syntax broke our build (or rather, uglify didn't understand it). Not saying it should be fixed, but it might be of interest.

@mpowaga
Copy link
Contributor

mpowaga commented Mar 29, 2018

Thanks for pointing this out @johnste. I'll fix it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants