You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With React 15, support for ref and constant string has been dropped:
React-specific properties on DOM refs (e.g. this.refs.div.props) were deprecated, and are removed now. (@jimfb in facebook/react#5495)
I propose to reintroduce it in react-templates, because it's particularly useful when working with templates, since the alternatives/workarounds are rather clumsy.
It could be either an extension of the existing ref or a new rt-ref.
Example:
<div><inputrt-ref="myinput" />
</div>
would make the input tag available as this.myinput.
In practice the rt-ref would be turned into a ref using the following transformation:
Apparently I was wrong (or perhaps they dropped emitting the warning) but the ref string attribute is still valid in react though now considered "legacy".
From the react docs:
The ref String Attribute
Note: Although string refs are not deprecated, they are considered legacy, and will likely be deprecated at some point in the future. Callback refs are preferred.
So closing this for now, will reopen it in case they'll drop the feature.
With React 15, support for
ref
and constant string has been dropped:I propose to reintroduce it in react-templates, because it's particularly useful when working with templates, since the alternatives/workarounds are rather clumsy.
It could be either an extension of the existing
ref
or a newrt-ref
.Example:
would make the input tag available as
this.myinput
.In practice the
rt-ref
would be turned into aref
using the following transformation:The text was updated successfully, but these errors were encountered: