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
Usually forwardRef components are declared directly without an explicit type, with the return type of the function itself imposing the component type automatically.
Like such:
The real type of these components is React.ForwardRefExoticComponent which would be a real drag to need to add to every component manually.
Would it be possible to add a way for this transformer to detect forwardRef calls and add an appropriate displayName without relying on an explicit type annotation in that case?
Great library otherwise though, very convenient.
The text was updated successfully, but these errors were encountered:
@FrobtheBuilder are you sure that adding MyComponent.displayName will effect the component name?
Because if you have const MyComponent = React.memo(() => {...}) and you add MyComponent.displayName it has no affect and in devTools the name is unknown
Usually
forwardRef
components are declared directly without an explicit type, with the return type of the function itself imposing the component type automatically.Like such:
The real type of these components is
React.ForwardRefExoticComponent
which would be a real drag to need to add to every component manually.Would it be possible to add a way for this transformer to detect
forwardRef
calls and add an appropriatedisplayName
without relying on an explicit type annotation in that case?Great library otherwise though, very convenient.
The text was updated successfully, but these errors were encountered: