Workiva / react-dart

Dart Bindings for React JS
BSD 2-Clause "Simplified" License
412 stars 67 forks source link

Improve forwardRef documentation, add displayName argument #251

Closed aaronlademann-wf closed 4 years ago

aaronlademann-wf commented 4 years ago

While grokking our forwardRef API, I found myself wanting some implementation examples which could not be found in the documentation comment.

I also noticed that consumers had no way to define a displayName for the wrapper HOC created by forwardRef.

These changes address both issues by adding extensive examples in the documentation comment for forwardRef that mirror the analogous ReactJS forwardRef documentation, and by adding a displayName argument to the function which then gets set on the JS side via a call to defineProperty.


FYA: @greglittlefield-wf @joebingham-wk @sydneyjodon-wk