jquense / uncontrollable

Wrap a controlled react component, to allow specific prop/handler pairs to be uncontrolled
MIT License
199 stars 33 forks source link

Improve component displayName in React 16 #38

Open vhfmag opened 5 years ago

vhfmag commented 5 years ago

When used in a React 16 context, the final component (the result of uncontrollable(MyComp)) has the rather opaque name ForwardRef (demo: https://r4qeq.codesandbox.io/)

If you find it worth the effort, I could submit a tiny PR giving a display name to the function passed to forwardRef (https://github.com/jquense/uncontrollable/blob/master/src/uncontrollable.js#L122-L124), hence renaming the final component to something like ForwardRef(myFunctionName). The displayName variable (https://github.com/jquense/uncontrollable/blob/master/src/uncontrollable.js#L6) could be used for this.

Thank you for this library (and many others)!