Material-ui: [Core] Replace string refs with callback refs

Created on 23 Feb 2016  路  3Comments  路  Source: mui-org/material-ui

React docs says the following about string refs:

React also supports using a string (instead of a callback) as a ref prop on any component, although this approach is mostly legacy at this point.

There are also React issues that indicate string refs will eventually be deprecated. We should consider moving to callback refs when we're able to do so.

discussion

Most helpful comment

This issue is beeing addressed in the next branch. To have more context on why it's bad, you can have a look at https://news.ycombinator.com/edit?id=12093234
We should make sure that the corresponding eslint rule is enforced.

All 3 comments

Yeah I agree with you :+1: :+1:

This issue is beeing addressed in the next branch. To have more context on why it's bad, you can have a look at https://news.ycombinator.com/edit?id=12093234
We should make sure that the corresponding eslint rule is enforced.

As pointed out by @gulderov, the no-string-refs eslint rule is now enforced. We can close the issue.

Was this page helpful?
0 / 5 - 0 ratings