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
In cases where we useforwardRef, forwardRef returns an object rather than a react class/function. This means that BaseComponent.prototype is undefined and causes the following error:
The text was updated successfully, but these errors were encountered:
I just ran into this in a side project and while adding a check for BaseComponent.prototype would work the other problem is that we still always set a ref.
We could make that conditional as well in the case of an arrow function component. I tried briefly looking into using React.forwardRef but I think that opens a big can of worms.
In cases where we use
forwardRef
,forwardRef
returns an object rather than a react class/function. This means thatBaseComponent.prototype
isundefined
and causes the following error:The text was updated successfully, but these errors were encountered: