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
The Text component allows for a ref for the underlying HTML element via including React.HTMLAttributes<HTMLElement> in the props. However, the component passes its own ref in here. This results in a ref passed to Text never being invoked/set.
Ideally instead this ref should compose with whatever ref is passed
The text was updated successfully, but these errors were encountered:
I may be wrong, but I actually don't think ref is exposed in React.HTMLAttributes<HTMLElement> (it would be in React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>>). Would you want this as a feature request?
I may be wrong, but I actually don't think ref is exposed in React.HTMLAttributes<HTMLElement> (it would be in React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>>). Would you want this as a feature request?
Yeah, that sounds right. ref is not currently a supported prop of <Text>. Open to adding this prop as a feature request.
Ahhh. Looking a bit closer at our types I think its from us being on an older version of blueprint that still uses class components, which the React types auto adds a ref prop to looking at it?
Yeah, would be great to have this as a feature request!
With the class component implementation, you get a ref to the Text component instance, not the DOM node. Part of the motivation for migrating to FCs is to use forwardRef so that ref gives you access to the DOM node, like it would with intrinsic elements.
The
Text
component allows for aref
for the underlying HTML element via includingReact.HTMLAttributes<HTMLElement>
in the props. However, the component passes its own ref in here. This results in a ref passed toText
never being invoked/set.Ideally instead this ref should compose with whatever ref is passed
The text was updated successfully, but these errors were encountered: